> ## Documentation Index
> Fetch the complete documentation index at: https://e2e.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Errors

> Reference for e2e errors, with every error code you can see, its class, and the exit code it sets.

Every runner error carries a class and a code. The class sets the exit code,
and the code names the cause. `e2e login`,
`e2e logout`, and `e2e models` are the exception, under
[Exit codes](#exit-codes).

```ts title="tests/upgrade.e2e.ts"

test('upgrade to Pro', async ({ agent }) => {
  try {
    await agent.act('upgrade the workspace to Pro');
  } catch (error) {
    if (isAgentError(error) && error.code === 'STEP_TIMEOUT') {
      // the step ran out of time; the message carries the last judgment
      console.error(error.category, error.details);
    }
    throw error;
  }
});
```

## Reference

### Exit codes

| Class | Exit code |
| --- | ---: |
| test | 1 |
| configuration | 2 |
| infrastructure | 3 |
| internal | 4 |
| interrupted | 130 |

- In a mixed run the highest-precedence code present wins,
  `130 > 4 > 3 > 2 > 1 > 0`. The report keeps every individual result.
- A test whose cleanup failed (a required video that was not
  finalized, a session that did not close) exits with that cleanup error's
  code, usually 3.
- A setup assertion failure is a test failure and skips its dependents.
  Missing setup infrastructure keeps its configuration or infrastructure
  class.
- The `internal` class and exit code 4 are reserved for runner invariant
  violations. No first-party code raises a code in that class today.
- `e2e login`, `e2e logout`, and `e2e models` print a failure's message with
  no code and exit 1, or 130 when a sign-in or picker is cancelled.

Whether a CI job is worth retrying depends on the code:

| Exit | Meaning | Retry the job? |
| ---: | --- | --- |
| 1 | A test failed | Only if the test is flaky |
| 2 | Configuration, collection, or policy | Fix the reported problem first |
| 3 | Engine, app process, model provider, artifact, or cleanup infrastructure failure | If the cause is temporary |
| 4 | An internal runner error | Report it |
| 130 | The run was interrupted | |

| Codes | Description |
| --- | --- |
| [Agent codes](#agent-codes) | The `code` of an `AgentError` |
| [Runner codes](#runner-codes) | Plain strings in output and report |
| [Test code errors](#test-code-errors) | Thrown from test code |

### AgentError

`AgentError` is the runner-classified agent failure, exported from `e2e`.

```ts
export class AgentError extends Error {
  readonly code: AgentErrorCode;
  readonly category: 'test' | 'configuration' | 'infrastructure' | 'internal' | 'interrupted';
  readonly retryable: boolean;
  readonly details: ErrorDetails | undefined;
  readonly explanation: string;
  readonly screenshot?: string;
  readonly blocked: boolean;
}
```

| Field | Description |
| --- | --- |
| `code` | One of the [agent codes](#agent-codes), assigned by the runner and never taken from model text. |
| `category` | The error class under [Exit codes](#exit-codes). It sets the exit code. |
| `details` | Structured facts: locator, expected, observed, match count, wait time. |
| `explanation` | Sanitized, bounded prose. The same value as `message`. |
| `screenshot` | An artifact path, present only when evidence was captured and permitted. |
| `blocked` | `true` when the failure reports a blocked step, not a product failure. |

<Note>
In a test file, `instanceof AgentError` can be false. Use `isAgentError`
from `e2e` and branch on `code`, as in the example at the top of this page.
</Note>

#### Agent codes

The members of the closed `AgentErrorCode` union. `blocked:` names the
category a blocked verdict reports as the obstacle.

| Code | When it happens | Class | Exit |
| --- | --- | --- | ---: |
| `AUTH_CREDENTIAL_UNAVAILABLE` | A `Secret` or `credentials.user()` names a credential missing from `config.credentials`, the call ran outside an active runner, or the password's provider returned no string of at least 6 characters (code points) | configuration | 2 |
| `AUTH_CREDENTIAL_INVALID` | The application rejected a configured credential (blocked: credentials) | configuration | 2 |
| `SECRET_UNAVAILABLE` | A `Secret` or `secrets.get()` during a run names a secret missing from `config.secrets`, the secret's provider returned no string of at least 6 characters (code points), or an engine resolved a secret it did not declare in its `secrets`. Also `host.secret(name)` (`@e2e-dev/core`) naming a secret not passed to `launch` | configuration | 2 |
| `ENVIRONMENT_UNAVAILABLE` | The environment under test is down or unreachable beyond the app itself (blocked: environment) | infrastructure | 3 |
| `SEED_DATA_MISSING` | Data the step depends on does not exist in the environment (blocked: seed_data) | configuration | 2 |
| `TEST_SETUP_FAILED` | Test prerequisites outside the product failed to arrange (blocked: test_setup). Also a `test.extend()` fixture that broke its contract: it returned without calling `use()`, or called it twice | configuration | 2 |
| `AUTOMATION_UNSUPPORTED` | The step needs an interaction the available toolset cannot perform, such as a right-click on a device (blocked: automation) | test | 1 |
| `MODEL_UNAVAILABLE` | No model configured: the built-in agent's `agents.<name>.model` holds no AI SDK model instance (the message names the selected agent), or GitHub Copilot does not serve the configured model to this account (`model_not_supported`; the message names the model). Recorded once as a run-level error, and the run stops. In a test run, a missing model is found when the `agent` fixture is first acquired, and an unserved model at its first call. `e2e explore` checks before anything starts: the built-in agent needs a model, and a custom executor it keeps (one with `extend`) needs `answer`, a `judge`, or a `model` to plan the steps with. In a test run a custom executor without a model is not checked: its `act` and `assert` steps run, and `waitFor` or `extract` fails with this code on its first call when neither the entry nor the executor holds a `judge` or `model` and the executor has no `answer`. Evicts no [recording](https://e2e.com/docs/cache). | configuration | 2 |
| `POLICY_DENIED` | The security policy refused an operation: a denied destination, a forbidden fill, `vision: 'only'` without pixels, or a read from a secure field. Also an `app.open` link with a refused scheme. [Policy denials](https://e2e.com/docs/reference/security#policy-denials) lists every case | configuration | 2 |
| `APP_UNREACHABLE` | The app URL could not be reached, an app command exited or exceeded `startupTimeout`, or its `env` function didn't return within `startupTimeout`. An exit after readiness during `e2e run` interrupts active tests and skips queued tests only for dependent targets with unfinished work. See [app commands](https://e2e.com/docs/reference/config#command) for diagnostics. Under the agent, also any engine fault with no more specific code. On a device, the message can identify a busy or wedged iOS automation runner and its recovery. See [Mobile](https://e2e.com/docs/mobile#troubleshooting). | infrastructure | 3 |
| `APP_ALREADY_RUNNING` | `readyUrl` answered before the target's `app.command` was spawned, and `reuseExisting` was not in effect. Stop that process, or set `reuseExisting: true` locally | infrastructure | 3 |
| `MODEL_PROVIDER_FAILED` | Provider transport failure (network error, 5xx, rate limit, a key the provider rejected, or no response within 120 s) after up to 5 transport retries per model call, which honor `retry-after` and stay within the step timeout. Also a call to the built-in agent's model with no key configured: the provider package found no API key in its variable, or the Vercel AI Gateway found neither a key nor an OIDC token. The message names the variable, such as `AI_GATEWAY_API_KEY is not set`. Only the steps that call the model fail: an `agent.act` step that replays a [recording](https://e2e.com/docs/cache) and a test with no agent call still run. The 120 s covers the whole request, so a model that needs longer for one answer fails here too. An error body the provider package cannot read shows as the HTTP status and the body, secrets redacted. Also a call the provider ended on an `error` finish, whatever text came with it, and an `e2e doctor --check-model` call with no answer within 1 minute. Evicts no [recording](https://e2e.com/docs/cache) | infrastructure | 3 |
| `CANCELLED` | The runner cancelled the operation without a process signal: an `e2e mcp` `open_session` cut short by a client cancel, a closed connection, or the server's shutdown, after it stopped what it had started. In `@e2e-dev/core`, an operation a `signal` aborted, or one on a closed session. Some calls in test code fail with `CANCELLED` as a [test code error](#test-code-errors) instead | infrastructure | 3 |
| `MODEL_OUTPUT_INVALID` | Structured output still failed validation after the repair budget was spent. Under a [decision model](https://e2e.com/docs/decision-models): an answer without a valid choice distribution, a choice the request never offered, or a question the provider refused. Decisions are not repaired | test | 1 |
| `APP_NOT_OPEN` | An operation needed an open app: `app.open()` had not run, or the engine reported invalid state | test | 1 |
| `LOCATOR_NOT_FOUND` | No matching node within the deadline, or an agent action refers to a node that is no longer available. For a filtered locator the message can also list how many candidates each filter step left | test | 1 |
| `LOCATOR_AMBIGUOUS` | More than one match for a single-node operation. Fails at once, with no polling. For a filtered locator the message can list how many candidates each filter step left | test | 1 |
| `ACTION_FAILED` | Actionability failure, operation timeout, or an action that may already have committed. Also `inputValue()` on a node with no value, `isChecked()` on a node with no checked state, and a `request` call whose network failed | test | 1 |
| `STEP_BUDGET_EXHAUSTED` | The model-call or action-step budget ran out before a conclusion | test | 1 |
| `STEP_TIMEOUT` | The invocation deadline expired. Carries the last judgment where one exists, with the [vision hint](https://e2e.com/docs/reference/agent#agent-assert) when that judgment was inconclusive | test | 1 |
| `CONTEXT_OVERFLOW` | A request exceeded the model's context window. `act` shortens its history and retries once; judgments fail at once. Lower `agents.<name>.maxObservationBytes`, or split the instruction into shorter steps. Reported as blocked: automation | test | 1 |
| `MODEL_REFUSED` | The model refused the request (finish reason `content-filter`) and returned no usable answer. Rephrase the instruction or use another model. Reported as blocked: automation | test | 1 |
| `ASSERTION_FAILED` | `agent.assert` judged false, or a locator, `browser`, or value matcher failed | test | 1 |
| `ASSERTION_INCONCLUSIVE` | `agent.assert` could not judge: the screen did not show enough to decide either way (the relevant part is not on screen, still loading, or unreadable). `agent.extract` raises it when the model answers that the screen does not show the requested data, instead of returning a placeholder. A failure, never a pass; the explanation says what was missing. Judged from the tree alone with `vision` off, the message can add a [vision hint](https://e2e.com/docs/reference/agent#agent-assert) | test | 1 |
| `AUTHENTICATION_FAILED` | The executor concluded that signing in failed inside the app: a product verdict. `AUTH_CREDENTIAL_INVALID` is the blocked counterpart, for a configured credential the app rejects | test | 1 |
| `STEP_NO_CONCLUSION` | The executor used every turn without calling `complete_step`. The step fails with the agent's last summary | test | 1 |
| `REPLAY_STALE` | Under `cache.strict` or `--strict-cache`, the step's recording exists but no longer replays, so the step fails with no model call instead of handing off to the agent. `step.cache.reason` is one of `invalid-entry`, `wrong-context`, `target-not-found`, `target-ambiguous`, `viewport-changed`, `action-failed`, `action-uncertain`, `end-mismatch`, or `no-entry` while the cache directory (not a custom `cache.store`) holds a recording of the step under another key, which the message names. Not retried. To fix it, re-record with a read-write run without the flag, with `cache.strict` off if the config set it, then commit the changed entry. The message names the knob that turned strict on and the configured cache directory (or `cache.store`) | configuration | 2 |

### Runner codes

These appear in terminal output and in the report as plain string codes.

| Code | When it happens | Class | Exit |
| --- | --- | --- | ---: |
| `CONFIG_NOT_FOUND` | `--config <path>` names a file that does not exist, or no `e2e.config.ts`, `e2e.config.mts`, `e2e.config.js`, or `e2e.config.mjs` exists from the working directory up to the repository root | configuration | 2 |
| `CONFIG_AMBIGUOUS` | Both `e2e.config.ts` and `e2e.config.mts` in one directory, or both `e2e.config.js` and `e2e.config.mjs` in one with no TypeScript config | configuration | 2 |
| `CONFIG_LOAD_FAILED` | The config module failed to import: a package that is declared but not installed, an undeclared package, a wrong subpath, a removed export, or any other throw while it evaluates. The message names the fix. A config error raised while it evaluates keeps its own code: options a factory the config calls refuses, or a `secrets.get()` handle turned into a string, is `INVALID_CONFIG` | configuration | 2 |
| `INVALID_CONFIG` | The config failed validation. A factory the config module calls (`web()`, `mobile()`, `defineEngine()`, `decisionExecutor()`, `decisionFilter()`) refused its options, with the factory's own message. **Any key:** unknown (the message names the nearest one), out of range, an invalid enum, or removed: `specVersion`, top-level `limits`, the artifact kinds list (`artifacts: [...]`, `artifacts.kinds`), the `artifacts.trace` and `artifacts.video` blocks (the message names the `trace` or `video` option they meant), the agent keys `timeout` and `maxTurns` (the message names `judgmentTimeout` and `maxModelCalls`), and `createToolLoopExecutor({ maxTurns })`. **Targets:** missing `targets`; a key outside `{ name, platform, engine, app, trace, video }`; a duplicate or malformed name; an `engine` that is not a `defineEngine` handle; `app` without an engine; a malformed `app` key; a file `app.url` where the engine does not open files; a `web()` target without `app.url` or with a device field; a `mobile()` target without `app.bundleId` or `app.appPath`, with `app.url` (not supported yet), with a link in `bundleId`, or with an unknown permission name or state; an `app.linkBase` where the engine opens no links, or one that is not an absolute URL or scheme, has a query or fragment, or names a refused scheme; a `trace` or `video` that is not a recording mode. **App command:** an `args` entry or `env` value that is not a string (an `undefined` `env` value is dropped instead); an `env` function that throws an error without its own error code, or returns something other than an object of strings and `undefined` values; `reuseExisting` with an `app.url` that asks for a free port; a port-0 `app.url` with no `app.command`. **Secrets and credentials:** a secret or credential password shorter than 6 characters (code points); a `secrets.get()` in an engine option that names no `secrets` entry (a credential's password is not one); a `secrets.get()` handle turned into a string while the config evaluates (a template literal, `String()`), or given where a string is needed (only an engine option that declares secrets takes one); a credential that is not `{ username, password }`, whose `username` is not a string (only `password` may be a function), or that has no username in the config or `E2E_USER_<NAME>_USERNAME`; two credentials or two secrets whose names map to one `E2E_USER_*` or `E2E_SECRET_*` override variable (`api-key` and `api_key`). **Agents:** an entry that is a bare `StepExecutor` (the message names `{ executor }`) or a model instance (the message names `{ model }`); `system` or `tools` beside `executor`; a `tools` entry that `defineTool` did not build, or that takes a built-in tool name (a grammar verb, `complete_step`, `locate`, `run_code`, `test_lines`, `start_recording`, `stop_recording`, or `report_finding`); an oversized `context`. **Tests, filters, services, reporters:** a `tests` value that is not a glob or a list of globs, or a list of only `!` exclusions; a `filters` value that is not a list of `{ name, filter }` (for a bare function such as `decisionFilter`, the message says to call it), or a filter `name` that breaks the target name rules, is longer than 256 characters, or is used twice; a `services` value that isn't a plain object, or an entry that isn't a plain object with a `start` function or has another key; the `json` reporter combined with `list`, or in a run with `--step`. **`expect.poll` and `toPass`:** options that are not a plain object; a call timeout that is invalid or above 2147483647 ms; an `expect.poll` `timeout` of 0 outside a test, hook, or hosted session, an invalid `interval` value or `intervals` list, or both set; a `toPass` call with an invalid `intervals` list, or no positive timeout outside an attempt or hook; a `toPass` config value with the wrong shape, or an invalid timeout or interval list (entries must be positive safe integers) | configuration | 2 |
| `CONFIG_NOT_DETERMINISTIC` | A worker re-resolved the config module and got a different digest than the runner | configuration | 2 |
| `INVALID_SERVICE_VALUE` | A [service](https://e2e.com/docs/services) yielded a value that isn't a plain object, contains a value that can't be copied, like a custom class instance, or contains a function inside a map or a set. The error message names the service and the path to the value | configuration | 2 |
| `APP_URL_REQUIRED` | A navigation or relative URL on a target that declares no `app.url` (on a device target with no `app.linkBase`, `app.open(path)`), or an `app.command` with no `app.url` or `app.readyUrl` to poll | configuration | 2 |
| `INVALID_APP_URL` | A base URL that is unparseable or has userinfo, a query, a fragment, a scheme other than `http:`, `https:`, and `file:`, or plain HTTP on a non-loopback host; a `file:` URL with a host or of a directory; port 0 on a host other than a literal loopback address (`127.0.0.1`, `[::1]`); or a loopback address the run could not bind a free port on | configuration | 2 |
| `INVALID_GLOB` | An empty pattern; a first segment that starts with `!` beyond the one leading `!` of a `tests` exclusion (`!!tests/**`, `./!tests/**`); a bare `!`; braces, character classes, or extglobs; a backslash separator; an absolute path or a `..` segment; a trailing `/` or `.`; a `tests` entry with no wildcard that names a directory (the message names the glob to write); a pattern that names only the project root; or a `**` that is not a whole segment | configuration | 2 |
| `UNKNOWN_TARGET` | `--target`, `open_session.target`, or `openHost` (`e2e/runner`) named a target that is not configured | configuration | 2 |
| `TARGET_REQUIRED` | `e2e mcp` or `openHost` (`e2e/runner`): the config declares several targets and none was named. Or `e2e run --device` with several selected targets whose engines choose a device; pick one with `--target` | configuration | 2 |
| `NO_SESSION` | `e2e mcp`: `call` or `tools` before `open_session` or after the session ended (the message names why), or `call`, `tools`, or `close_session` naming a `session` id that is not open or is closing | configuration | 2 |
| `SESSION_REQUIRED` | `e2e mcp`: `call`, `tools`, or `close_session` without a `session` while several sessions are open. The message lists them | configuration | 2 |
| `ENGINE_IN_USE` | `e2e mcp`: `open_session` on a target whose engine instance another open session drives, because the config gets it from a package every session shares. Create the engine in the config, or in a file it imports by path | configuration | 2 |
| `ENGINE_NOT_INSTALLED` | `e2e mcp`: `open_session {engine}` named a package that is not installed in the project, beside e2e, or in `~/.e2e/engines`. The message names the install command | configuration | 2 |
| `CONFIG_IN_USE` | `e2e mcp`: `open_session` on a config other than the one the open sessions use, or on a config while sessions opened with `engine` are open. Credentials and secrets resolve process-wide, so open on that config or close those sessions first | configuration | 2 |
| `SESSION_OPEN` | `e2e mcp`: `open_session` while every session slot (`--max-sessions`, default 4) holds an open, opening, or closing session, or while the server shuts down. Close one first | configuration | 2 |
| `UNKNOWN_TOPIC` | `e2e mcp`: an `e2e://guide/{topic}` resource named a topic the skill does not have. The message lists them | configuration | 2 |
| `UNKNOWN_TOOL` | `e2e mcp`: `call` or `tools` named a tool the session's catalog does not have. The message lists the catalog. An action verb the engine does not declare is `UNSUPPORTED_CAPABILITY` instead | configuration | 2 |
| `TEST_AMBIGUOUS` | `e2e mcp`: `open_session`'s `test` selected several tests on the session's target. The message lists them as `file:line` | configuration | 2 |
| `SESSION_TEST_UNSUPPORTED` | `e2e mcp`: `open_session`'s `test` selected a test a session cannot run alone: a serial group member, a test that starts from a setup test's `session`, or a test that runs as several agents. Run it with `e2e run` | configuration | 2 |
| `UNSUPPORTED_ARTIFACT` | A [`video` mode](https://e2e.com/docs/reference/config#recording) set on a target, or on a test that will run there, records on some attempt, and the target's engine cannot record video. The message names the target, and the test for a test's mode. A mode from the config root or `--video` never raises it: it applies to the targets that can record, with a notice naming the rest | configuration | 2 |
| `UNSUPPORTED_CAPABILITY` | A fixture, action, or tier the target's engine does not declare: a built-in fixture a worker fixture uses while no test or suite hook runs (a fixture that isn't on any target in the config is `COLLECTION_ERROR`), `screen` without `locate`, state restore without `state`, screenshots without `artifacts`, `app.clearState()` on a persistent browser context (the message names the mode), `agent.assert` `vision` with an executor that does not declare `vision: true`, `app.startRecording()` while the test's video records, `browser.webmcp` in a browser or on a page without WebMCP, or `toBeInViewport` on an engine without `viewportIntersection`, on a node whose bounds or screen position the engine cannot report, or with `ratio` above 0 on an engine that reports no share of the box, such as a device. Also `e2e run --device` when no selected target's engine chooses a device (`web()`), or the target's devices come from a device provider. Also a run that includes a `desktop()` target on any OS but macOS, before any test starts | configuration | 2 |
| `NO_TESTS` | Zero runnable ordinary test-target pairs. The message names the cause: no file matched the `tests` globs (it lists look-alike files), a positional matched nothing (it names the `!` entry that excludes a file the positional names), a file registered no tests, or filters excluded everything. Suppress with `--pass-with-no-tests`. When [test filters](https://e2e.com/docs/filters) leave nothing to run, the run passes instead (exit 0). Also `e2e mcp`'s `open_session` when its `test` selects no runnable test. | configuration | 2 |
| `RUNNER_BUSY` | A suite overlapped another suite, an opening or open host, or a live attempt; or a host opened during a suite; or `e2e run --step` started without a terminal in a directory where another run is already controlled with `e2e run --step`; or a test reached `screen.pause()` in a run without a terminal while another run in the directory was controlled that way; or a run killed while it took control of the directory left its lock (the message names the file to remove). Await the suite and close existing hosts before you retry; end a stepped run with `e2e run --step stop`, or remove the lock file the message names. | configuration | 2 |
| `RUNNER_NOT_INSTALLED` | `test`, `describe`, or a hook from `@e2e-dev/web`, `@e2e-dev/mobile`, or `@e2e-dev/desktop` was called where `e2e` is not installed, as in a program on `@e2e-dev/core` alone. The engine factory from the same entry still works. Install `e2e` to write tests | configuration | 2 |
| `NO_LAST_RUN` | `--last-failed` found no `report.json` where the run writes it, or a file there that is not a `report-1` document. Run once without the flag first. | configuration | 2 |
| `INVALID_CHANGED_SINCE` | `--changed-since` (`changedSince`) is not a string, is empty, or starts with `-`. Or, when the run calls test filters or `e2e explore` explores the change, it names no commit in the checkout or shares no history with HEAD (in a shallow clone the message says to fetch more history, otherwise that the histories are unrelated); or the project is not in a git repository, git is missing, or git did not answer within 30 seconds | configuration | 2 |
| `ONLY_IN_CI` | A focused test reached a CI run | configuration | 2 |
| `COLLECTION_ERROR` | Registration outside collection; an invalid title; a non-function body; an async `describe` body; nested serial groups; an option forbidden inside a serial group; a setup test inside `describe`; an invalid session name; a malformed test option, such as `tags` that is not a list of distinct names; a test or `describe` option key the call does not take (the message names the nearest one); a test file that fails to import, in a run with no positionals or when the positionals selected it; a session that a selected test consumes, or `e2e explore --session` names, but no collected setup test produces (the message lists the declared sessions); a consumed session on a target whose engine has no `state` capability to save it; a positional path outside the project root; or a fixture rule, reported with the file and line of the code: a test body, hook, or `test.extend()` fixture function that does not destructure its first parameter, takes a rest property there, or is a bound function, a test that runs naming a fixture that isn't on any target in the config, a `beforeAll`, `afterAll`, or worker fixture that names a test fixture, fixtures that name each other in a cycle, or a `test.extend()` fixture whose `scope` or `auto` differs from that of the fixture it extends | configuration | 2 |
| `SESSION_MISMATCH` | A stored session does not match the current run, target, engine, platform, or app identity. Also an `@e2e-dev/core` `SessionState` passed to a host of another engine, platform, or app | configuration | 2 |
| `SESSION_EXPIRED` | A stored session, or an `@e2e-dev/core` `SessionState`, is past its expiry at restore or import time (configuration, exit 2), or a setup test saved state whose expiry is not after its creation (test, exit 1) | configuration or test | 2 or 1 |
| `SESSION_INVALID` | A stored session failed authentication. Tampered or corrupt. Also `SessionState.import` (`@e2e-dev/core`) on bytes that are not a `session-state-1` document or that fail authentication under the key: another key, or a changed byte | configuration | 2 |
| `SESSION_UNAVAILABLE` | A test requires a session no selected setup test produced | configuration | 2 |
| `SESSION_CONTRACT` | A setup test saved a session twice, saved an undeclared name, or finished without saving a declared one | test | 1 |
| `TEST_TIMEOUT` | The attempt exceeded the resolved test `timeout`. The body is not stopped, but the operation it is in is cancelled and its fixtures end with the attempt. A test that blocks the event loop gets its worker killed once `cleanupTimeout` (at least 5 s) passes after the timeout. See [Hooks](https://e2e.com/docs/reference/test#hooks) | test | 1 |
| `PAUSE_UNAVAILABLE` | A test called `screen.pause()` where nobody can resume it: in a run with `CI` set. The test fails at the line of the call. Remove the call, or run the test with `e2e run` without `CI` set | test | 1 |
| `STEP_NOT_AWAITED` | The test body settled while a step it started was still running: a step call without `await`. The step fails at the line of the call and is cancelled, and the message names the code that started it: the test body, a `beforeEach` hook, or a fixture's setup. The attempt fails with this code when the body returned. When the body threw, the attempt keeps the body's error and records this one under `secondaryErrors`. An `expect.poll` matcher or `toPass` call still running when the body, an `afterEach` hook, or a fixture teardown returned fails that phase the same way, at the line of the call, and is cancelled. A `launch()` or `host.newSession()` (`@e2e-dev/core`) still opening when the body returned fails the attempt the same way, and the opening is cancelled; one that failed and whose error the test caught does not. One left by a `beforeAll` or `afterAll` hook, or a step such a hook left running, fails the hook with `HOOK_FAILED` | test | 1 |
| `UNHANDLED_REJECTION` | A promise rejected with no test running. An unhandled rejection is charged to the test running when it surfaces. Between tests it is this run error, naming the last test that finished in the worker as the likely source. Before any test has finished in the worker, it ends the worker instead: the rejection is the run error, and the test on its way fails with `WORKER_CRASH`. When the worker was still starting, no test fails: the test waiting for it goes back to the queue for another worker, and the start counts toward `WORKER_INIT_FAILED`. In `e2e mcp`, a test a session runs is charged the same way while its code runs; after its body ended, the rejection is this code, reported by `close_session`, or a warning on stderr once the session has closed | test | 1 |
| `HOOK_FAILED` | `beforeAll` or `afterAll` threw. Skips the suite's tests. | test | 1 |
| `UNEXPECTED_PASS` | A test marked [`test.fail`](https://e2e.com/docs/reference/test#test-fail) passed. Retried like any test failure. Remove the mark once the cause is fixed | test | 1 |
| `RUN_TIMEOUT` | The run spent its [`maxDuration`](https://e2e.com/docs/reference/config#maxduration) or `--max-duration`. The running tests end as `interrupted`, and the rest are skipped with cause `time-limit` | test | 1 |
| `LAUNCH_TIMEOUT` | Engine init or attempt start exceeded `config.launchTimeout` | infrastructure | 3 |
| `CLEANUP_TIMEOUT` | Engine attempt end exceeded `config.cleanupTimeout`, a route or dialog handler the engine ran for the test was still running when the attempt settled, or a host or session the test opened with `launch()` did not close in that time | infrastructure | 3 |
| `SERVICE_START_FAILED` | A [service's](https://e2e.com/docs/services) `start` function threw, finished without yielding, isn't an async generator, or didn't yield within its `startupTimeout`. Any services already started are stopped | infrastructure | 3 |
| `SERVICE_STOP_FAILED` | A [service's](https://e2e.com/docs/services) code after `yield` threw, yielded a second time, or didn't finish within the service's `shutdownTimeout`. Recorded as a cleanup error | infrastructure | 3 |
| `BROWSER_INSTALL_FAILED` | Browser provisioning failed | infrastructure | 3 |
| `ELECTRON_INSTALL_FAILED` | `@e2e-dev/electron` could not download the Electron binary of the project's `electron` package, or a worker started without it (a host that skipped the engine's prepare step); or it could not download the ffmpeg a video recording needs | infrastructure | 3 |
| `WORKER_INIT_FAILED` | Workers for a target failed to start twice since the last one became ready. A start fails when the worker exits, or reports an uncaught exception or unhandled rejection, before it is ready. The target's remaining tests are skipped | infrastructure | 3 |
| `WORKER_EXIT` | A worker exited unexpectedly while running a file. The test in flight fails with `WORKER_CRASH`, and the file's other tests are skipped. Attempts that finished before the exit stay in the report. When an unhandled rejection ends the worker (see `UNHANDLED_REJECTION`), the rejection is the run error, not this one | infrastructure | 3 |
| `WORKER_CRASH` | A worker exited during a specific test | infrastructure | 3 |
| `WORKER_ENTRY_MISSING` | The worker entry module could not be resolved. Packaging fault. | infrastructure | 3 |
| `NODE_UNSUPPORTED` | The runtime cannot run e2e: a Node.js outside `^22.22.3 \|\| >=24.8.0`, a Bun older than 1.4.3, or Deno. The CLI exits 2 with the same sentence before it starts. On Bun, `run`, `list`, `explore`, and `openHost` from `e2e/runner` throw it too: they need Node.js | infrastructure | 3 |
| `TYPESCRIPT_COMPILER_UNAVAILABLE` | oxc, which compiles e2e's TypeScript, could not be loaded; the message gives the cause. Most often its native bindings for this platform (`@oxc-transform/binding-<platform>-<arch>`, `@oxc-parser/binding-<platform>-<arch>`) are not installed: npm leaves them out with `--omit=optional`, or when `package-lock.json` was written on another platform (npm/cli#4828). Install again without `--omit=optional`, or delete `package-lock.json` and `node_modules` and run `npm install` | infrastructure | 3 |
| `IMAGE_CODEC_UNAVAILABLE` | `@e2e-dev/util`, whose native addon reads, writes, resizes, masks, and compares the PNGs of screenshots, could not be loaded; the message gives the cause. `@e2e-dev/core` loads it the first time it works on a screenshot's pixels (`toHaveScreenshot`, `locator.screenshot()`, or resizing one for the model), so a run that does none never needs it; a plain `app.screenshot()` saves the engine's PNG without it. `@e2e-dev/mobile` loads it when the engine loads, so a mobile project without it fails while its config loads, with `@e2e-dev/util`'s own error (`NativeUtilUnavailableError`, no code) as the cause. Builds exist for macOS 13 or later (`darwin-arm64`, `darwin-x64`), Linux with glibc 2.28 or later or with musl (`linux-x64-gnu`, `linux-arm64-gnu`, `linux-x64-musl`, `linux-arm64-musl`), and Windows (`win32-x64-msvc`, `win32-arm64-msvc`), each in `@e2e-dev/util-<platform>`. Most often the build for this platform is not installed: the cause and fix are those of `TYPESCRIPT_COMPILER_UNAVAILABLE`. On a platform with no build, `toHaveScreenshot` and `locator.screenshot()` cannot work, and neither can an agent screenshot the runner has to resize (one with a side over 768 px) | infrastructure | 3 |
| `ENGINE_FAILURE` | Any engine fault with no more specific mapping | infrastructure | 3 |
| `WORKER_PROTOCOL` | A worker reported the wrong unit, an attempt overlapped a live attempt, `openHost` tried to acquire an engine instance another host owns, or `host.openSession` tried to reuse a closed host or overlap an opening, live, or closing session. In `@e2e-dev/core`, `launch` on an engine instance another host owns, or `host.newSession` on a closed host or while a session is open | infrastructure | 3 |
| `SESSION_KEY_INVALID` | A worker received a session key that is not 32 bytes. Packaging or IPC fault. | infrastructure | 3 |
| `REPORT_WRITE_FAILED` | `report.json` or `ai-trace.json` could not be written. Recorded as a run error; the in-memory outcome is still complete. A `junit.xml`, `summary.md`, or `ctrf.json` that could not be written is a line on its reporter's stderr instead | infrastructure | 3 |
| `EVALUATE_FAILED` | `browser.evaluate` threw inside the page, `electron.evaluate` threw in the main process or `window.evaluate` in a window's page (`@e2e-dev/electron`), a page timer threw while `browser.clock` ran it, or the page deleted or replaced a JavaScript built-in (such as `Map`) that the engine's in-page code needs, which fails later evaluates and locators (`@e2e-dev/web`) | test | 1 |
| `INTERRUPTED` | A user or CI signal aborted the run. A test cut short by `--max-failures` or the time limit also ends with this code, and its message names the limit; that run exits 1, not 130 | interrupted | 130 |

#### Test code errors

| Code | When it happens | Class | Exit |
| --- | --- | --- | ---: |
| `INVALID_ARGUMENT` | Argument validation in test code refused an argument | test | 1 |
| `INVALID_LOCATOR` | Argument validation in test code refused a locator's arguments, or the engine could not parse the selector it was given (a malformed CSS selector, `xpath=`, `text=/(/`, an unknown engine) | test | 1 |
| `CANCELLED` | A `test.step()`, a `request` call, or a call on a fixture an engine contributes, like `browser.evaluate`, cut short while it ran, as at the test timeout. Also a `test.step()` called from work its phase left running, such as a body or hook past its timeout | test | 1 |
| `ERROR` | A value thrown from test code that no other code classifies | test | 1 |

## Common errors

The codes a failed run shows most often, with the usual cause and the fix.
[Debugging a run](https://e2e.com/docs/debugging) walks through a failure.

| Code | Usual cause | Fix |
| --- | --- | --- |
| `APP_UNREACHABLE` | Nothing answers at `app.url`, or `app.command` never became ready. On iOS, the message may name the automation runner instead | Set `app.command.log` and read it; check the port; raise `app.command.startupTimeout`. For the iOS runner, follow the message (see [Mobile](https://e2e.com/docs/mobile#troubleshooting)) |
| `APP_ALREADY_RUNNING` | Something already serves `app.url` when the runner wanted to start `app.command` | Stop it, or set `reuseExisting: true` for local runs |
| `LOCATOR_NOT_FOUND` | Wrong role or name, text not exact, element inside an iframe, page not open | Read the markup for the accessible name; try `exact: false`; `browser.frameLocator` for iframes; `--headed` to look |
| `LOCATOR_AMBIGUOUS` | Two matches: a hidden duplicate, a repeated label | Add `{ name }`, scope under a container, `filter`, `first()`, or `{ visible: true }` |
| `ASSERTION_FAILED` | The expectation is wrong, or the state settles after 5 s; for `agent.assert`, the judgment was false | Compare with the screenshot; `{ timeout }` on the matcher; rewrite the question |
| `ASSERTION_INCONCLUSIVE` | `agent.assert` or `agent.extract` asked about something the screen doesn't show: on another page, still loading, or only in pixels | Open or wait for the right screen first; add `vision: true` when the answer is in pixels (the message says so) |
| `ACTION_FAILED` | Element covered, disabled, or detached, or an operation timed out | Wait on the right condition with `expect` first; close overlays |
| `STEP_BUDGET_EXHAUSTED`, `STEP_TIMEOUT` | The agent ran out of actions, model calls, or time | Scope the goal to one step. Raise the agent entry's `maxSteps` or `maxModelCalls` for the budget, the config `timeout` for an `act` step, or the agent's `judgmentTimeout` for `assert`, `waitFor`, and `extract` |
| `MODEL_UNAVAILABLE` | No model constructed in the config, or GitHub Copilot doesn't serve the configured model to your account | See [Models](https://e2e.com/docs/models); for Copilot, [Pick a model](https://e2e.com/docs/subscriptions#pick-a-model) |
| `MODEL_PROVIDER_FAILED` | Missing or bad key, rate limit, no credits, or every try of one request went 120 s without an answer | Check the key the provider reads and the quota; for a slow local model, a smaller screen (`agents.<name>.maxObservationBytes`) or a faster model |
| `MODEL_REFUSED` | The model refused the prompt (finish reason `content-filter`). Exit 1 | Rephrase the instruction, or switch to another model |
