From 25e2bb6cd05a773de8e1f097b10eb0d8551ffd4c Mon Sep 17 00:00:00 2001 From: Derek Christensen Date: Sat, 30 Dec 2023 00:33:52 -0700 Subject: [PATCH] Fix worker coreURL for ESM --- packages/ffmpeg/src/worker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ffmpeg/src/worker.ts b/packages/ffmpeg/src/worker.ts index f17a444423..07462711cf 100644 --- a/packages/ffmpeg/src/worker.ts +++ b/packages/ffmpeg/src/worker.ts @@ -54,7 +54,7 @@ const load = async ({ // when web worker type is `classic`. importScripts(_coreURL); } catch { - if (!_coreURL) _coreURL = CORE_URL.replace('/umd/', '/esm/'); + if (!_coreURL || _coreURL === CORE_URL) _coreURL = CORE_URL.replace('/umd/', '/esm/'); // when web worker type is `module`. (self as WorkerGlobalScope).createFFmpegCore = ( (await import(