Crux
Errors

Runtime Errors

Stable Runtime Engine diagnostic codes, causes, and fixes.

Runtime Engine public failures use CruxRuntimeError. Every error has a stable code, a user-facing explanation, what still works, and an exact next step.

import { CruxRuntimeError } from "@use-crux/core/runtime";

try {
  await flow.waitFor(event);
} catch (error) {
  if (error instanceof CruxRuntimeError) {
    console.error(error.code, error.nextStep);
  }
}

Codes

CodeMeaning
RUNTIME_REQUIREDA runtime-bound API was called without config({ runtime }).
CAPABILITY_MISSINGThe configured stack cannot support a used runtime feature.
TARGET_NOT_FOUNDA wake named a target missing from the runtime entry.
TARGET_DUPLICATETwo runtime targets share one durable name.
TARGET_NOT_EXPORTEDA discovered target cannot be imported as a named export.
REPLAY_DIVERGEDFlow replay no longer matches the suspended snapshot fingerprint.
ARTIFACTS_STALEGenerated runtime artifacts are stale.
WAKE_UNVERIFIEDHTTP wake verification failed before durable state was touched.
PUBLIC_URL_UNRESOLVEDProduction HTTP wake has no stable public URL.
SETUP_REQUIREDRequired adapter resources are missing or mismatched.
PAYLOAD_NOT_JSONA durable runtime payload is not JSON-compatible.
WORK_DEAD_LETTEREDWork exhausted retries and is terminal until operator retry.
LEASE_LOSTA stale worker tried to commit after losing its lease.
NAMESPACE_AMBIGUOUSThe inferred runtime namespace is unsafe or ambiguous.
RUNTIME_HOST_ONLYA host-bound runtime was used outside its host boundary.

Request-scoped defer codes

Public defer() failures use CruxDeferError from @use-crux/core.

CodeMeaning
DEFER_SCOPE_REQUIREDNo active execution scope or ambient host binding.
DEFER_CAPABILITY_MISSINGActive scope cannot honor this overload.
DEFER_SCOPE_SEALEDRegistration after the invocation sealed.
DEFER_LIMIT_EXCEEDEDHost callback/nesting bounds exceeded.
DEFER_REPLAY_UNSAFEPublic defer() inside replayable flow execution.
DEFER_TARGET_INPUT_REQUIREDNamed target missing required JSON input.
DEFER_COMMIT_FAILEDNamed work could not commit before the response.

On this page