Skip to content

Commit

Permalink
revert register import
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi committed Dec 4, 2023
1 parent b8c6a55 commit 712ff64
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/waku/src/lib/middleware/rsc/worker-impl.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file can depend on Node.js

import url from 'node:url';
import { parentPort } from 'node:worker_threads';
import { register } from 'node:module';
import { Server } from 'node:http';
import { createServer as viteCreateServer } from 'vite';
import type { ViteDevServer } from 'vite';
Expand All @@ -15,6 +16,9 @@ import { rscDelegatePlugin } from '../../vite-plugin/rsc-delegate-plugin.js';

const IS_NODE_20 = Number(process.versions.node.split('.')[0]) >= 20;
if (IS_NODE_20) {
const {
default: { register },
} = await import('node:module');
register('waku/node-loader', url.pathToFileURL('./'));
}
const controllerMap = new Map<number, ReadableStreamDefaultController>();
Expand Down

0 comments on commit 712ff64

Please sign in to comment.