Skip to content

Commit bf347d0

Browse files
committed
feat(cloudflare): add AsyncLocalStorage import for improved context management
1 parent 75461d8 commit bf347d0

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

packages/cloudflare/src/cli/adapter.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ export default buildAdapter((config: OpenNextConfig, buildOpts: BuildOptions) =>
6161
cloudflareBanner.push(
6262
"import process from 'node:process';",
6363
"import { Buffer } from 'node:buffer';",
64+
"import { AsyncLocalStorage as NodeAsyncLocalStorage } from 'node:async_hooks';",
65+
"globalThis.AsyncLocalStorage = NodeAsyncLocalStorage;",
6466
"import { createRequire as topLevelCreateRequire } from 'module';",
6567
"const require = topLevelCreateRequire(import.meta.url);",
6668
"import bannerUrl from 'url';",

0 commit comments

Comments
 (0)