Skip to content

Commit fa343a8

Browse files
don't set AsyncLocalStorage in global scope
1 parent b3c0a38 commit fa343a8

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

node_package/src/ReactOnRailsRSC.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,6 @@ import createReactOutput from './createReactOutput';
99
import { isPromise, isServerRenderHash } from './isServerRenderResult';
1010
import ReactOnRails from './ReactOnRails';
1111

12-
(async () => {
13-
try {
14-
// @ts-expect-error AsyncLocalStorage is not in the node types
15-
globalThis.AsyncLocalStorage = (await import('node:async_hooks')).AsyncLocalStorage;
16-
} catch (e) {
17-
console.log('AsyncLocalStorage not found');
18-
}
19-
})();
20-
2112
const stringToStream = (str: string) => {
2213
const stream = new PassThrough();
2314
stream.push(str);

0 commit comments

Comments
 (0)