Initialise request scoping on runtimes without a synchronous require.
Under pure ESM there is no require, so the synchronous path above cannot
load node:async_hooks and runWithGraphStore would silently degrade to the
module-level store — which does NOT isolate concurrent requests. An ESM server
must therefore await prepareGraphStoreScope() once during startup, before
serving traffic.
Safe to call anywhere: it resolves to false in the browser and is idempotent.
Initialise request scoping on runtimes without a synchronous
require.Under pure ESM there is no
require, so the synchronous path above cannot loadnode:async_hooksandrunWithGraphStorewould silently degrade to the module-level store — which does NOT isolate concurrent requests. An ESM server must thereforeawait prepareGraphStoreScope()once during startup, before serving traffic.Safe to call anywhere: it resolves to
falsein the browser and is idempotent.