From 263c4be409fadf1150f5b8ee13a58fd3dc6adf4b Mon Sep 17 00:00:00 2001 From: 3dtours Date: Sun, 26 Jul 2026 18:55:08 +0700 Subject: [PATCH] fix: use importmap to resolve spessasynth_core bare import - Add importmap in index.html to map spessasynth_core to CDN URL - Load spessasynth_lib from CDN directly (with importmap resolving deps) - WorkerSynthesizer fallback also uses CDN import - Ensures library and processor use same spessasynth_core version --- app/static/js/services/soundfontPlayer.js | 2 +- app/templates/index.html | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/static/js/services/soundfontPlayer.js b/app/static/js/services/soundfontPlayer.js index 4af774e..8f3f1b9 100644 --- a/app/static/js/services/soundfontPlayer.js +++ b/app/static/js/services/soundfontPlayer.js @@ -67,7 +67,7 @@ _initInProgress = false; console.warn("[SonicSF] AudioWorklet failed, trying WorkerSynthesizer:", e); try { - const mod = await import("https://esm.sh/spessasynth_lib@4.3.1"); + const mod = await import("https://cdn.jsdelivr.net/npm/spessasynth_lib@4.3.1/dist/index.js"); _synthInstance = new mod.WorkerSynthesizer(audioContext); await _synthInstance.isReady; _initialized = true; diff --git a/app/templates/index.html b/app/templates/index.html index 5bbd52f..e36b58d 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -10,11 +10,18 @@ +