Skip to content

Commit dac7903

Browse files
committed
fix
1 parent a7d1d12 commit dac7903

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/vike/node/vite/shared/getHttpRequestAsyncStore.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// TODO: refactor
22
// - rename this file
3+
// - move this file to /server/runtime/
34
// - rename HttpRequestAsyncStore
45

56
// Purpose of this file:
@@ -22,10 +23,11 @@ import {
2223
type PageContextBegin,
2324
renderPageServer_addAsyncHookwrapper,
2425
} from '../../../server/runtime/renderPageServer.js'
25-
import { assert, assertIsNotProductionRuntime, getGlobalObject, isObject } from '../utils.js'
26+
import { assert, assertIsNotBrowser, getGlobalObject, isObject } from '../../../server/utils.js'
2627
import type { AsyncLocalStorage as AsyncLocalStorageType } from 'node:async_hooks'
28+
import { import_ } from '@brillout/import'
2729

28-
assertIsNotProductionRuntime()
30+
assertIsNotBrowser()
2931

3032
type HttpRequestAsyncStore = null | {
3133
httpRequestId: number
@@ -38,7 +40,7 @@ const globalObject = getGlobalObject('getHttpRequestAsyncStore.ts', {
3840
async function installHttpRequestAsyncStore(): Promise<void> {
3941
let mod: typeof import('node:async_hooks')
4042
try {
41-
mod = await import('node:async_hooks')
43+
mod = await import_('node:async_hooks')
4244
} catch {
4345
return
4446
}

0 commit comments

Comments
 (0)