vitest-dev/vitest

Documented errors, page 2 of 4. Back to vitest-dev/vitest

Code / MessageTypeSeverityTags
Runner must export a default function, but got
exception error config, runner, custom-runner, esm
[vitest] vi.mock(" ", factory?: () => unknown) is not…
exception error vitest, mocker, vi-mock, factory, exports
aria adapter expects an Element
exception error browser, aria, snapshot, dom, type-guard
Cannot provide " " because it's not serializable.
exception error provide, inject, serialization, structured-clone, config
Access denied to " ". See Vite config documentation for…
exception error security, vite-fs, filesystem, config, access-control
failed to parse
exception error automock, parser, ast, vi-mock
Browser name is required. Please, set…
validation error browser-provider, config, instances, validation, browser
You cannot set "coverage.reportsDirectory" as
exception error config, coverage, safety, filesystem
You've enabled headless mode for "preview" provider but it…
exception error browser, config, provider, preview, headless
Cannot take a screenshot outside of a test.
exception error browser, screenshot, test-lifecycle, worker-state
toHaveFormValues must be called on a form or a fieldset…
exception error browser, expect, matcher, form, type-guard
`bench.compare()` requires at least 2 benchmarks, received
exception error benchmark, compare, validation, arity
Exact option does not support RegExp expected class names
exception error browser, expect, matcher, class, options
Cannot resolve user fixtures. See errors for more…
exception error fixtures, dependency-injection, aggregate-error
Method "getByRole" is not supported by the
exception error browser, locators, provider, preview
[@vitest/web-worker] Cannot initiate a custom Web Worker.
exception error web-worker, environment, dom, configuration
Environment " " is not a valid environment. Path " "…
exception error environment, vm, pool, setupvm
task " " was not defined
exception error benchmark, compare, validation, lookup
The ` ` callback was called multiple times in the ` ` hook…
exception error hooks, around-hook, lifecycle
Browser is not initialized
exception error browser, preview, lifecycle, initialization, internal
cannot be used with "not
exception error snapshot, negation, chai, api-misuse
Calling the test function inside another test function is…
exception error suite, collector, lifecycle
For a percentage based memory limit a percentageReference…
exception error memory, config, percentage, vmmemorylimit
This command can only be called inside a test file.
exception error browser, tracing, lifecycle, internal, filesystem
Vitest failed to access its internal state. One of the…
exception critical runtime, worker-state, config, globalsetup
Browser Mode requires the "provider" to always be specified.
validation error browser, config, provider, vitest
expects the actual value to be a benchmark result.
exception error bench, matcher, type-validation
Unexpected file type
exception error filesystem, edge-case
Page " " not found in browser.
exception error browser, playwright, session, lifecycle, race-condition
The `browser.provider` configuration was changed to accept…
exception error config, browser, provider, migration
[vitest] "registerHooks" is not available when running in…
exception error vm, module-system, esm-loader, runtime
TypeScript compiler returned help text instead of type…
exception error typecheck, typescript, tsconfig, config
Vitest failed to find
exception error setup, config, import-context, runtime
Cannot annotate tests outside of the test run. The test
exception error test-context, annotations, lifecycle, artifact
expected must be a function, received
exception error snapshot, tothrowerrormatchingsnapshot, chai-assertion, api-misuse
[vitest] The provider was closed.
exception error browser, playwright, lifecycle, race-condition, teardown
Failed to load benchmark provider from
exception error benchmark, provider, configuration, module-import
Failed to load custom "defines
exception error config, define, serialization, worker
MemberExpression is not supported. Please open a new bug…
exception error automock, destructuring, member-expression, vi-mock
Cannot spy on export
exception error spy, esm, mocking, module-namespace
Failed to load custom CoverageProviderModule from
exception error coverage, custom-provider, import, config
The provider does not support tracing.
exception error browser, tracing, provider, playwright, config
Calling the suite function inside test function is not…
exception error suite, collector, lifecycle
Failed to load . Default export is missing.
exception error coverage, v8, istanbul, version-mismatch, build
Hook () can only be called inside a test
exception error hooks, test-context, lifecycle
Cannot automock ' ' because it failed to parse.
exception error mocker, automock, parse-error, acorn
Cannot set serialized manual mock. Define a factory…
exception error registry, mock-registry, manual-mock, serialization
Browser provider is not defined for the project
exception error cdp, browser-provider, lifecycle, browser
invalid snapshot serializer in
exception error config, snapshot, serializer, validation, typeerror
process.nextTick cannot be mocked inside child_process
exception error fake-timers, nexttick, child-process, pool-config
.toHaveDisplayValue() currently does not support input
exception error browser, expect, matcher, form, input-type
VITEST_RANGE_LOCATION_FILTER_PROVIDED
Found "-" in location filter
exception error cli, filter, location, range, test-selection
Cannot create a benchmark project because the name
exception error benchmark, config, naming
"Istanbul" coverage provider is not compatible with…
exception error config, coverage, experimental, validation
.toContainHTML() expects a string value, got
exception error browser, expect, matcher, type-guard, html
Unable to set breakpoint, CDP not supported
exception error browser, debugger, cdp
Vitest wasn't able to resolve any project.
exception error workspace, config, browser, resolution
The ` ` callback was not called in the ` ` hook. Make sure…
exception error hooks, around-hook, lifecycle
provider is not supported
exception error browser, tracing, provider, filesystem, internal
Test attachment requires "body" or "path" to be set. Both…
validation error artifacts, attachments, validation, type-error
[vitest] Cannot resolve
exception error browser-mode, import-actual, module-resolution, vite-alias
Cannot define a nested project for a
exception error browser, config, naming
Cannot merge reports when `--reporter=blob` is used. Remove…
exception error reporters, blob, merge-reports
Failed to import custom OpenTelemetry SDK script
exception error opentelemetry, tracing, configuration, dynamic-import
onCleanup can only be called once per fixture. Define…
exception error fixtures, cleanup, builder-pattern
Test specification for task
exception error watcher, rerun, reported-entity
Environment doesn't provide a valid context. It should be…
exception error environment, vm, context, iscontext
Expected DOM element to be an instance of Element, received
exception error internal, browser, dom, serialization
Test runner doesn't support test artifacts.
exception error artifacts, runner, api-support, experimental
You cannot use without "--no-file-parallelism
exception error cli, inspect, debug, parallelism
Method "elementLocator" is not supported by the
exception error browser, locators, provider, preview
snapshot function didn't throw
exception error snapshot, tothrowerrormatchingsnapshot, assertion-failure
value must be , received
exception error config, type-validation, typeof
VITEST_FILES_NOT_FOUND
No test files found
exception error file-resolution, glob, no-tests
[vitest] `importScripts` is not supported in Vite workers…
exception error web-worker, esm, vite, migration
Cannot use CDP because browser API write or exec operations…
exception error security, cdp, api-config, access-control, browser
Project name " " from " " is not unique. The project is…
exception error projects, config, naming, workspace
Tester RPC " " was not established.
exception error cdp, tester, websocket, rpc, browser
Failed to mock ' '. See the cause for more information.
exception error mocker, manual-mock, parse-error, module-lexer
Invalid tags expression: expected
exception error cli, tags, parser, validation
Cannot import " ": the test context was torn down.
exception error vm, lifecycle, dynamic-import, teardown, async
done() callback is deprecated, use promise instead
exception error test-context, async, migration, deprecated-api
Runner must implement "importFile" method.
exception error config, runner, custom-runner, validation
unknown source type while automocking
exception error automock, ast, parser, internal-guard
vi.when: the argument must be a mock function created with…
exception error vi-when, mocking, type-guard, vi-fn, vi-spyon
Provider does not support command " ".
exception error browser-command, lookup, provider, runtime
Task instance was not found for
exception error internal, reporter, state
VITEST_INCLUDE_TASK_LOCATION_DISABLED
Received line number filters while `includeTaskLocation` option is disabled
exception error cli, filter, config
Test attachment with "path" should not have "bodyEncoding"…
validation error attachments, test-context, validation, artifact
Custom CoverageProviderModule loaded from
exception error coverage, custom-provider, default-export, config
vitest/browser can be imported only inside the Browser…
exception error browser, import-guard, build-config, environment
[vitest] Mocks require an id string.
exception error registry, mock-registry, internal-api, validation, typeerror
Unsupported framework
exception error cli, browser, scaffolding, framework
Runner is not supported. Test files: .
exception error pool, worker-type, config
--shard must be a positive number
exception error cli, shard, validation
Cannot call "onTestFinished" inside a test hook.
exception error hooks, test-context, lifecycle
Pool " " cannot run with "experimental.viteModuleRunner…
exception error config, vm, pool, module-runner, experimental
You cannot use --shard option with enabled watch
exception error cli, shard, watch, ci
Invalid data URI encoding
exception error vm, esm, data-uri, wasm, validation
stackblitz environment does not support the
exception error browser, provider, environment, stackblitz