From 09def59cacc52d23a0eb4bad96c4ea24db3825a3 Mon Sep 17 00:00:00 2001 From: 3dtours Date: Sun, 26 Jul 2026 18:09:12 +0700 Subject: [PATCH] fix: use esm.sh CDN to resolve spessasynth_core bare import - jdelivr raw index.js has bare import 'spessasynth_core' which browser can't resolve - esm.sh automatically rewrites bare imports to full URLs - Keep jdelivr for worklet processor (self-contained, no imports) - WorkerSynthesizer fallback also uses esm.sh --- app/static/js/services/soundfontPlayer.js | 3 ++- app/templates/index.html | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/static/js/services/soundfontPlayer.js b/app/static/js/services/soundfontPlayer.js index c1339cf..847ea19 100644 --- a/app/static/js/services/soundfontPlayer.js +++ b/app/static/js/services/soundfontPlayer.js @@ -68,7 +68,8 @@ } catch (e) { console.warn("[SonicSF] SpessaSynth AudioWorklet init failed:", e, "- trying WorkerSynthesizer..."); try { - const { WorkerSynthesizer } = await import(window.__SpessaSynthCDN + "index.js"); + const mod = await import("https://esm.sh/spessasynth_lib@4.3.1"); + const WorkerSynthesizer = mod.WorkerSynthesizer; _synthInstance = new WorkerSynthesizer(audioContext); await _synthInstance.isReady; _initialized = true; diff --git a/app/templates/index.html b/app/templates/index.html index f5ce43e..af5ed9f 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -11,10 +11,10 @@