Errors
DEFER_CAPABILITY_MISSING
The active scope cannot honor this defer() overload.
What failed
An active Crux scope exists, but it cannot support the requested defer() form.
Common cases:
- Inline
defer(callback)on Convex or Lambda named-only hosts - Missing
waitUntil/afterport - Named work on a host with
durableFinalization: false - Async scope without a lifetime capability facet
Why
Crux refuses to advertise reliability a host cannot provide. Inline closures are not durable; named work needs durable finalization before response commit.
What still works
- The other overload when the host supports it (named on Convex/Lambda with Runtime)
- Hosts with full lifetime ports for inline work
flow.defer()for replay-safe durable flow children
Fix
- Inline unsupported: switch to
await defer(target, input)with Runtime, or move the work to a host that supports inline drain. - Missing port: pass an explicit
waitUntil/afterinto@use-crux/core/defer/serverlessor use@use-crux/next. - Named without durability: enable
durableFinalization: trueon a Runtime- capable host integration and configureconfig({ runtime }).
See hosts and troubleshooting.