Skip to content

Commit b5bea7d

Browse files
committed
fix
1 parent dca45df commit b5bea7d

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:
@@ -23,10 +24,11 @@ import {
2324
renderPageServer_addAsyncHookwrapper,
2425
} from '../../../server/runtime/renderPageServer.js'
2526
import { preparePageContextForPublicUsageServer } from '../../../server/runtime/renderPageServer/preparePageContextForPublicUsageServer.js'
26-
import { assert, assertIsNotProductionRuntime, getGlobalObject, isObject } from '../utils.js'
27+
import { assert, assertIsNotBrowser, getGlobalObject, isObject } from '../../../server/utils.js'
2728
import type { AsyncLocalStorage as AsyncLocalStorageType } from 'node:async_hooks'
29+
import { import_ } from '@brillout/import'
2830

29-
assertIsNotProductionRuntime()
31+
assertIsNotBrowser()
3032

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

0 commit comments

Comments
 (0)