Skip to content

DF0007: AsyncLocalStorage Not Set

Package: devframe

Message

AsyncLocalStorage is not set, it likely to be an internal bug of the DevTools foundation

Cause

getCurrentRpcSession() was called outside the RPC dispatch context. Usually indicates the RPC server hasn't been composed with startHttpAndWs or the caller is running before the async context is established.

Fix

Only call getCurrentRpcSession() from RPC handlers executed by the server. Report as a bug if you hit this inside a handler.

Source

packages/devframe/src/node/host-functions.ts

Migrated from

Previously documented as DTK0021 under @vitejs/devtools.

Released under the MIT License.