vitest-dev/vitest
Documented errors, page 3 of 4. Back to vitest-dev/vitest
| Code / Message | Type | Severity | Tags |
|---|---|---|---|
| Unexpected value for --expect.poll | exception | error | cli, expect, poll, options, transform |
| Expected config.test.coverage.thresholds to be an object | exception | error | coverage, thresholds, config-validation |
| The child process was torn down or never initialized. This… | exception | error | internal-bug, worker-pool, forks, lifecycle, race |
| Signature "test(name, fn, )" was deprecated in Vitest 3 and… | exception | error | api-signature, migration, v4, deprecated-api |
| Test file " " was not registered, so it cannot be updated… | exception | error | api, websocket, editor-integration, file-registration |
| `bench()` expects a benchmark function. Call `bench(name… | validation | error | benchmark, api-usage, validation, missing-function |
| Project name " " is not unique. All projects should have… | exception | error | projects, config, naming, inject |
| The VM environment was not defined in the Vite config. This… | exception | error | internal-bug, environment, vite, vm, transform |
| invalid snapshot serializer file | exception | error | config, snapshot, serializer, validation, esm |
| Invalid tick mode | exception | error | fake-timers, settimertickmode, validation, api-misuse |
| The `test.workspace` option was removed in Vitest 4… | exception | error | config, workspace, vitest-4, migration, deprecation |
| vi.mock() expects a string path, but received a | exception | error | vi-mock, hoisting, type-error, module-path |
| Circular fixture dependency detected | exception | error | fixtures, dependency-injection, cycle |
| [@vitest/mocker] `createMockInstance` is not defined. This… | exception | error | mocker, automock, internal, vi-mock, vitest-bug |
| Invalid command name | validation | error | browser-command, validation, identifier, config |
| Cannot find iframe with id | exception | error | browser, orchestrator, iframe, race-condition, ui-mode |
| Expected a single value for option | exception | error | cli, cac, options, argument-parsing |
| Failed to load custom Reporter from | exception | error | reporter, config, module-loading |
| A function to advance timers was called but the timers APIs… | exception | error | fake-timers, usefaketimers, ordering, api-misuse |
| error.message | exception | error | pretty-format, plugin, serialization |
| Invalid data URI | exception | error | vm, esm, data-uri, imports, validation |
| [vitest] Mocks require a raw string. | exception | error | registry, mock-registry, internal-api, validation, typeerror |
| Failed to initialize projects. There were errors during… | exception | error | projects, config, aggregate-error, setup |
| Test worker should expose "runTests" method. Received | exception | error | worker, version-mismatch, build, runtime |
| is not a spy or a call to a spy! | validation | error | expect, mock, spy, jest-expect |
| `bench.compare()` expects every argument to be the return… | exception | error | benchmark, compare, validation, argument-shape |
| Cannot modify file " ". File writing is disabled because… | exception | error | browser, security, api, config |
| Cannot spawn child server without a parent dev server. | exception | critical | lifecycle, browser, vite-server, internal-invariant, ordering |
| (customMessage ? ` : ` : '') + message() | exception | error | expect, jest-extend, custom-matcher, assertion |
| No projects were found in | exception | error | projects, config, workspace, empty |
| Errors occurred while running tests. For more information… | exception | error | pool, worker, aggregate-error |
| Vitest standalone mode requires --watch | exception | error | cli, standalone, watch |
| ${error instanceof Error ? error.message : String(error)} | exception | error | coverage, thresholds, config-parse, magicast |
| Method "getByLabelText" is not supported by the | exception | error | browser, locators, provider, preview |
| The file " " must start with "vitest.config"/"vite.config"… | exception | error | config, projects, naming |
| The instance cannot have a different provider from its… | exception | error | browser, config, instances, provider, validation |
| vitest.mergeReports() requires all blob files to be… | exception | error | reporter, blob, merge, version |
| Vitest received --browser flag, but no project had a… | exception | error | cli, browser, workspace, config |
| Expected "vitest" as the first argument, received | exception | error | cli, parsecli, argv, programmatic-api |
| Cannot take a screenshot in a concurrent test because… | exception | error | browser, screenshot, concurrency, isolation |
| createNodeImportMeta is not supported in this version of… | exception | error | vite, peer-dependency, version-compat, module-runner |
| Method "getByTestId" is not supported by the | exception | error | browser, locators, provider, preview, testid |
| Benchmark provider loaded from | exception | error | benchmark, provider, default-export, esm |
| Cannot use two functions as arguments. Please use the… | exception | error | api-signature, validation |
| Found a circular "projects" definition | exception | error | projects, config, circular, workspace |
| Tester HTML file " " doesn't exist. | exception | critical | browser, tester, html, config, build |
| Received value must be an object when the matcher has… | exception | error | snapshot, matcher, properties, validation |
| File is required to collect tasks. | exception | error | collector, internal, validation |
| Method "frameLocator" is not supported by the | exception | error | browser, locators, provider, preview, iframe |
| require() is not supported in virtual modules. Trying to… | exception | error | virtual-modules, esm, cjs, require, module-runner |
| Tag name " " is already defined in "test.tags". Tag names… | exception | error | config, tags, duplicate, validation |
| Missing data URI encoding | exception | error | vm, esm, data-uri, wasm, validation |
| [vitest] Mocks require a url string. | exception | error | registry, mock-registry, internal-api, validation, typeerror |
| Expected IP address, received | exception | error | network, http, ipv4, vm, internal-helper |
| `bench()` does not accept options as the third argument… | validation | error | benchmark, api-usage, argument-order |
| expected promise to throw an error, but it didn't | exception | error | expect, async, promise, matcher |
| invalid return value in globalSetup file | exception | error | globalsetup, lifecycle, config, teardown |
VITEST_GIT_NOT_FOUND Could not find Git root. Have you initialized git with `git init`? | exception | error | git, vcs, cli |
| browser is not initialized | exception | error | browser, provider, initialization, config |
| Test runner doesn't support test annotations. | exception | error | runner, annotations, custom-runner, artifact |
| .toHaveProperty() expects to receive a valid object, but got | validation | error | expect, assertion, null-check, jest-expect |
| Unexpected message | exception | error | internal-bug, typecheck, worker-pool, ipc, version-mismatch |
| vi.doMock() expects a string path, but received a | exception | error | vi-domock, type-error, module-path, dynamic-mocking |
| Environment doesn't provide "getVmContext" method. It… | exception | error | environment, vm, setupvm, getvmcontext |
| pretty-format: Option "theme" has a key | exception | error | pretty-format, theme, ansi-styles, highlight |
| Unknown value for "test.listTags | exception | error | config, tags, validation, cli |
| [vitest] Redirect mocks require a redirect string. | exception | error | vitest, mocker, vi-mock, redirect |
| expect.customEqualityTesters: Must be set to an array of… | exception | error | expect, custom-equality, type-error, jest-matcher-utils |
| Inspector host cannot be a URL. Use "host:port" instead of | exception | error | config, inspector, debug, cli |
| expect.poll() is not supported in combination with .resolves | validation | error | expect, poll, resolves, syntax, jest-expect |
| Expected string coverage payload, received | exception | error | coverage, type-mismatch, worker-payload |
| invalid globalSetup file | exception | error | global-setup, exports, missing-export |
| Tag name " " is invalid. Tag names cannot contain "!", "*"… | exception | error | config, tags, validation, filter-expression, naming |
| `bench.from()` requires a name (string or named function)… | validation | error | benchmark, bench-from, api-usage, validation |
| Invalid tags expression: missing closing ")" in | exception | error | cli, tags, parser, validation |
| Snapshot file " " does not exist. | exception | warning | snapshot, filesystem, idempotency, browser |
| The snapshot state for | exception | error | snapshot, lifecycle, setup, state |
| Missing configurationFile. The… | exception | error | coverage, thresholds, config-file |
| Root path does not exist or is not a directory | exception | error | config, root, filesystem, resolveconfig |
| No projects matched the filter | exception | error | cli, workspace, project-filter, config |
| `bench.from()` expects a string path or a function… | validation | error | benchmark, bench-from, api-usage, validation |
| Projects definition references a non-existing file or a… | exception | error | config, projects, filesystem |
| The " " browser provider does not provide a… | exception | error | browser, provider, custom-plugin, type-error |
| vitest.mergeReports() expects all paths in | exception | error | reporter, blob, merge |
| pretty-format: Options "min" and "indent" cannot be used… | exception | error | pretty-format, options, conflict |
| Each tag defined in "test.tags" must have a "name"… | exception | error | config, tags, validation, resolveconfig |
| cannot read when saving inline snapshot | exception | error | snapshot, inline, filesystem, environment |
| .toHaveDisplayValue() currently supports only input… | exception | error | browser, expect, matcher, form, display-value |
| Cannot merge reports with --watch enabled | exception | error | cli, merge-reports, watch, ci |
| Unexpected value "--silent= | exception | error | cli, silent, options, transform |
| invalid diff config file | exception | error | config, diff, validation, esm |
| The browser configuration must have a "name" property. This… | exception | error | internal-bug, browser, instances, config |
| vi.doUnmock() expects a string path, but received a | exception | error | vi-dounmock, type-error, module-path, dynamic-mocking |
VITEST_LOCATION_FILTER_FILE_NOT_FOUND Couldn't find file . Note when specifying the test location you have to specify… | exception | error | cli, filter |
| Cannot upload files outside of a test | exception | error | browser, user-event, upload, lifecycle |
| Unexpected value for --expect | exception | error | cli, expect, options, transform |
| SchemaMatching expected to receive a Standard Schema. | validation | error | expect, asymmetric-matcher, schema, validation |
| The projects glob matched a file | exception | error | config, projects, glob |
| You must provide a Promise to expect() when using… | validation | error | expect, resolves, promise, type-error, jest-expect |
| vi.hoisted() expects a function, but received a | exception | error | mocker, vi-hoisted, type-error, browser |