vitest-dev/vitest · error · Error
Tester HTML file "${testerHtmlPath}" doesn't exist.
Error message
Tester HTML file "${testerHtmlPath}" doesn't exist. What it means
When `ProjectBrowser` is constructed, it resolves the tester HTML path — either `browser.testerHtmlPath` (resolved against `config.root`) or the built-in `distRoot/client/tester/tester.html` — and checks it exists. If missing, the orchestrator cannot load tests in the browser, so it throws immediately.
Source
Thrown at packages/browser/src/node/project.ts:52
public state: BrowserServerState = new BrowserServerState()
constructor(
public parent: ParentBrowserProject,
public project: TestProject,
public base: string,
) {
this.vitest = project.vitest
this.config = project.config
this.vite = parent.vite
// instances can override testerHtmlPath
const testerHtmlPath = project.config.browser.testerHtmlPath
? resolve(project.config.root, project.config.browser.testerHtmlPath)
: resolve(distRoot, 'client/tester/tester.html')
// TODO: when config resolution is rewritten, project and parentProject should be created before the vite server is started
if (!existsSync(testerHtmlPath)) {
throw new Error(`Tester HTML file "${testerHtmlPath}" doesn't exist.`)
}
this.testerFilepath = testerHtmlPath
this.testerHtml = readFile(
this.testerFilepath,
'utf8',
).then(html => (this.testerHtml = html))
}
private commands = {} as Record<string, BrowserCommand<any, any>>
public registerCommand<K extends keyof BrowserCommands>(
name: K,
cb: BrowserCommand<
Parameters<BrowserCommands[K]>,
ReturnType<BrowserCommands[K]>
>,
): void {
if (!/^[a-z_$][\w$]*$/i.test(name)) {View on GitHub (pinned to d568f8ce37)
Solutions
- If you set `browser.testerHtmlPath`, verify the file exists relative to `config.root` (use an absolute path to disambiguate).
- Remove the override to use the built-in tester: delete `browser.testerHtmlPath`.
- Reinstall `@vitest/browser` (and `vitest`) to restore the built-in `client/tester/tester.html`.
- If building from source, run the client build step (`pnpm build` in the browser package).
Example fix
// before
export default defineConfig({
test: { browser: { testerHtmlPath: './tester.html' } },
})
// after — file actually exists, or drop the override
export default defineConfig({
test: { browser: { enabled: true } },
}) Defensive patterns
Strategy: validation
Validate before calling
import { existsSync } from 'node:fs'
import { resolve } from 'pathe'
function assertTesterHtml(root: string, override?: string): void {
const path = override ? resolve(root, override) : undefined
if (path && !existsSync(path)) {
throw new Error(`Custom browser.testerHtmlPath not found at ${path}`)
}
} Prevention
- If overriding testerHtmlPath, point at a tracked file under the project root.
- Reinstall @vitest/browser if the built-in tester.html is missing.
- Run a config-validate step in CI before launching the browser server.
When it happens
Trigger: Configuring `browser.testerHtmlPath` to a path that doesn't exist; or a corrupt/missing Vitest install where the built-in `tester.html` is absent.
Common situations: Typo or wrong relative path in `testerHtmlPath`; pointing at a custom template that was moved/deleted; partial install of `@vitest/browser` (missing `client/tester/tester.html`); building from source and forgetting to run the client build.
Related errors
- Data was not properly initialized. This is a bug in Vitest.
- No codec found for type ${type}
- Unrecognized comparator ${comparator}
- vitest/browser can be imported only inside the Browser Mode.
- The browser configuration must have a "browser" property. Th
AI-assisted analysis of vitest-dev/vitest@d568f8ce37 (2026-08-03).
Data as JSON: /data/errors/0e782de344636d3d.json.
Report an issue: GitHub.