From a29e13fd18bcc09f43b32af80e9178801edf412e Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Thu, 23 Jul 2026 23:03:25 +0200 Subject: [PATCH] reference the file-search worker by its packaged .js name (#10290) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit svelte-package does not rewrite the string literal inside new URL(), and ships only the compiled searchWorker.js — so the .ts URL is dangling for any downstream consumer of @windmill-labs/components (rollup: Could not resolve searchWorker.ts). Vite maps .js back to the .ts source in-repo, so both builds resolve. Co-authored-by: Claude Opus 4.8 (1M context) --- frontend/src/lib/components/copilot/chat/files/fileEngine.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/lib/components/copilot/chat/files/fileEngine.ts b/frontend/src/lib/components/copilot/chat/files/fileEngine.ts index 5dbceb77e2..5508ab8b68 100644 --- a/frontend/src/lib/components/copilot/chat/files/fileEngine.ts +++ b/frontend/src/lib/components/copilot/chat/files/fileEngine.ts @@ -294,7 +294,10 @@ export function searchFilesInWorker( ): Promise { let worker: Worker try { - worker = new Worker(new URL('./searchWorker.ts', import.meta.url), { type: 'module' }) + // Reference the worker by its .js name: svelte-package doesn't rewrite this + // string literal and ships only searchWorker.js, so a `.ts` URL is dangling + // when the package is consumed downstream (vite maps `.js`→`.ts` here in-repo). + worker = new Worker(new URL('./searchWorker.js', import.meta.url), { type: 'module' }) } catch { return searchFiles(entries, pattern, opts) }