NAMESPACE_AMBIGUOUS
serverless() could not resolve a safe production Runtime Engine namespace.
What failed
serverless() throws this error while composing a runtime in production when it cannot resolve a safe namespace. A runtime namespace partitions all durable work, events, waiters, timers, outbox records, leases, and idempotency keys.
Why
Production and preview deployments can share a database or queue substrate. Falling back to local there could make those deployments share runtime state accidentally.
Resolution order
Crux uses the first available value:
serverless({ namespace: "..." })- A non-empty
CRUX_RUNTIME_NAMESPACEenvironment variable (surrounding whitespace is removed) - Vercel deployment inference:
VERCEL_ENV=productionresolves toproduction.VERCEL_ENV=previewwithVERCEL_GIT_COMMIT_REFresolves topreview-<branch>. Branch names are lowercased and sanitized; for example,Feature/Foobecomespreview-feature-foo.
- Outside production (
NODE_ENV !== "production"), Crux resolveslocalfor development.
If none of the first three steps applies in production, composition throws NAMESPACE_AMBIGUOUS.
What still works
Development can use the local fallback. Any serverless runtime with an explicit namespace, a configured environment namespace, or supported Vercel deployment signals continues to work.
Fix
Set a production namespace:
CRUX_RUNTIME_NAMESPACE=productionOr pass namespace in the runtime config:
serverless({
namespace: "production",
// store and wake adapters
});