Skip to content

Commit

Permalink
fix(createWebWorkerPromise): use type: 'module' option for Worker
Browse files Browse the repository at this point in the history
creation

Follow-up to #970 when using Vite with derived packages.
  • Loading branch information
thewtex committed Oct 13, 2023
1 parent c505f6e commit 92f9492
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/createWebWorkerPromise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' })
Expand Down

0 comments on commit 92f9492

Please sign in to comment.