From f3a4ab912860d26c5dc8777fabe96071af216d1f Mon Sep 17 00:00:00 2001 From: Derek Christensen Date: Wed, 6 Mar 2024 08:12:11 -0700 Subject: [PATCH] Fix worker coreURL for ESM (#657) --- 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 f17a444..0746271 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(