From 92f9492666772532eb20f4c420fd45bc045c961e Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Fri, 13 Oct 2023 12:25:28 -0400 Subject: [PATCH] fix(createWebWorkerPromise): use type: 'module' option for Worker creation Follow-up to #970 when using Vite with derived packages. --- src/core/createWebWorkerPromise.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/createWebWorkerPromise.ts b/src/core/createWebWorkerPromise.ts index 67fb29de5..052841972 100644 --- a/src/core/createWebWorkerPromise.ts +++ b/src/core/createWebWorkerPromise.ts @@ -49,7 +49,7 @@ async function createWebWorkerPromise (existingWorker: Worker | null, pipelineWo // Use the version built with the bundler // // Bundlers, e.g. WebPack, Vite, Rollup, see these paths at build time - worker = new Worker(new URL('../web-workers/pipeline.worker.js', import.meta.url)) + worker = new Worker(new URL('../web-workers/pipeline.worker.js', import.meta.url), { type: 'module' }) } else { if (workerUrl.startsWith('http')) { const response = await axios.get(workerUrl, { responseType: 'blob' })