Skip to content

Commit bbfdf42

Browse files
committed
also import corresponding clear function from node
1 parent 660cc24 commit bbfdf42

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

examples/playground15/instrumentation.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export function register() {
88
}, 0);
99
// This is to test that we have access to the node version of setTimeout
1010
timeout.unref();
11+
clearTimeout(timeout);
1112

1213
if (process.env.NEXT_RUNTIME === "nodejs") {
1314
globalThis["__NODEJS_INSTRUMENTATION_SETUP"] =

packages/cloudflare/src/cli/build/bundle-server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export async function bundleServer(buildOpts: BuildOptions): Promise<void> {
146146
},
147147
banner: {
148148
// We need to import them here, assigning them to `globalThis` does not work because node:timers use `globalThis` and thus create an infinite loop
149-
js: `import {setInterval, setTimeout, setImmediate} from "node:timers"`,
149+
js: `import {setInterval, clearInterval, setTimeout, clearTimeout, setImmediate, clearImmediate} from "node:timers"`,
150150
},
151151
platform: "node",
152152
});

0 commit comments

Comments
 (0)