quasarframework/quasar · error

The file /index.html is missing. Please add it back.

Error message

The file /index.html is missing. Please add it back.

What it means

appFilesValidations checks the project's index.html at startup. Quasar requires /index.html as the Vite entry template; if it is missing, the validation warns and returns false so the dev/build process can abort early instead of failing cryptically inside Vite.

Source

Thrown at app-vite/lib/utils/app-files-validations.js:12

import fs from 'node:fs'

import { warn } from './logger.js'
import { attachMarkup, entryPointMarkup } from '../plugins/vite.html.js'

export function appFilesValidations(appPaths) {
  let valid = true

  const file = appPaths.resolve.app('index.html')

  if (!fs.existsSync(file)) {
    warn('The file /index.html is missing. Please add it back.\n')
    return false
  }

  const content = fs.readFileSync(file, 'utf8')

  if (content.includes(attachMarkup)) {
    warn(`Please remove ${attachMarkup} from
    /index.html inside of <body>\n`)
    valid = false
  }

  if (!content.includes(entryPointMarkup)) {
    warn(`Please add ${entryPointMarkup} to
    /index.html inside of <body>\n`)
    valid = false
  }

  return valid

View on GitHub (pinned to 4841521b5f)

Solutions

  1. Restore index.html to the project root (quasar describe or scaffold from create-quasar to get a copy).
  2. If migrating from Quasar v1, create a Vite-style root index.html instead of src/index.template.html.
  3. Check git status / .gitignore so index.html is tracked in the repository.

Example fix

// restore minimal root index.html
<!DOCTYPE html>
<html>
  <head><title>Quasar App</title></head>
  <body>
    <div id="q-app"></div>
    <!-- quasar:entry-point -->
  </body>
</html>
Defensive patterns

Strategy: validation

Validate before calling

import { existsSync } from 'node:fs'
if (!existsSync('index.html')) throw new Error('index.html is missing at project root')

Prevention

When it happens

Trigger: Running quasar dev or quasar build when index.html has been deleted or renamed in the project root; called from #computeConfig via appFilesValidations(appPaths).

Common situations: Accidental deletion during cleanup, migration from old Quasar CLI v1 project structure (which used src/index.template.html), or a fresh clone missing untracked template files.

Related errors


AI-assisted analysis of quasarframework/quasar@4841521b5f (2026-08-30). Data as JSON: /api/errors/c03b2339cc3f8f7b. Report an issue: GitHub.