From a582e04bf40cf685f88bceaf88e3d24bde3d420a Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Sun, 5 Jul 2026 23:41:09 +0200 Subject: [PATCH] fix: rebuild windows bun loader main.ts filter from forward-slash cdir (#9946) --- backend/windmill-worker/loader.bun.windows.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/windmill-worker/loader.bun.windows.js b/backend/windmill-worker/loader.bun.windows.js index e89b70c26c..f024af671b 100644 --- a/backend/windmill-worker/loader.bun.windows.js +++ b/backend/windmill-worker/loader.bun.windows.js @@ -32,7 +32,11 @@ const p = { let cdirNodeModules = `${cdirFwd}/node_modules/`; - const filterLoad = new RegExp(`^${cdir}\/main\\.ts$`); + // Match the entry main.ts against bun's forward-slash resolver output on + // Windows — raw `cdir` carries backslashes that corrupt the regex, so the + // onLoad below would never fire and extensionless relative imports in + // main.ts would slip past filterResolve unrewritten. + const filterLoad = new RegExp(`^(?:${cdirFwd}|${cdirPosix})\/main\\.ts$`); const transpiler = new Bun.Transpiler({ loader: "ts", });