From a50f2abacb0a8f990bbf87e638f30c07c8e7dd0a Mon Sep 17 00:00:00 2001 From: Nyannyacha Date: Tue, 3 Feb 2026 05:31:42 +0000 Subject: [PATCH 1/2] fix: `process.std*` are not exposed in main worker --- ext/runtime/js/bootstrap.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/runtime/js/bootstrap.js b/ext/runtime/js/bootstrap.js index 765d296c..d1f080a7 100644 --- a/ext/runtime/js/bootstrap.js +++ b/ext/runtime/js/bootstrap.js @@ -768,7 +768,6 @@ globalThis.bootstrapSBEdge = (opts, ctx) => { }); } - const nodeBootstrap = globalThis.nodeBootstrap; if (nodeBootstrap) { nodeBootstrap({ runningOnMainThread: true, @@ -783,6 +782,8 @@ globalThis.bootstrapSBEdge = (opts, ctx) => { delete globalThis.bootstrapSBEdge; }; +const nodeBootstrap = globalThis.nodeBootstrap; + globalThis.bootstrap = { dispatchLoadEvent, dispatchUnloadEvent, @@ -794,3 +795,4 @@ globalThis.bootstrap = { core.setUnhandledPromiseRejectionHandler(processUnhandledPromiseRejection); core.setHandledPromiseRejectionHandler(processRejectionHandled); +nodeBootstrap({ warmup: true }); From 368d1c8fd6b40ecebd166057425b23c6b1e70886 Mon Sep 17 00:00:00 2001 From: Nyannyacha Date: Tue, 3 Feb 2026 05:31:53 +0000 Subject: [PATCH 2/2] fix: expose `MessagePort` --- ext/runtime/js/bootstrap.js | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/runtime/js/bootstrap.js b/ext/runtime/js/bootstrap.js index d1f080a7..9035efc3 100644 --- a/ext/runtime/js/bootstrap.js +++ b/ext/runtime/js/bootstrap.js @@ -263,6 +263,7 @@ const globalScope = { performance: writable(performance.performance), // messagePort + MessagePort: nonEnumerable(messagePort.MessagePort), MessageChannel: nonEnumerable(messagePort.MessageChannel), structuredClone: writable(messagePort.structuredClone),