From e903f98bbec98e4a78b1baba080533993b17be05 Mon Sep 17 00:00:00 2001 From: Lotus CI Date: Tue, 30 Jun 2026 00:37:51 -0400 Subject: [PATCH] lotus(#1): make denoise asset base absolute (fixes DTLN/DFN load) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Review found native dynamic import() of the DTLN/DeepFilterNet ESM resolves "./denoise/…" against the bundled JS chunk's URL (-> /assets/…) not the document, so those two models 404'd and silently fell back to raw mic in the default config. Resolve the asset base to an absolute same-origin href against the document; addModule()/fetch() accept absolute too, so all three load paths stay consistent. (rnnoise/speex were unaffected since addModule resolves against the document.) Co-Authored-By: Claude Opus 4.8 --- src/lotus/lotusDenoise.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lotus/lotusDenoise.ts b/src/lotus/lotusDenoise.ts index d785060e..f48aeef7 100644 --- a/src/lotus/lotusDenoise.ts +++ b/src/lotus/lotusDenoise.ts @@ -39,7 +39,12 @@ import { * malformed value falls back to the bundled "./denoise/". */ function safeAssetBase(raw: string | null): string { - const fallback = "./denoise/"; + // Resolve to an ABSOLUTE same-origin href against the document. Absolute is + // required because native dynamic `import()` (DTLN/DeepFilterNet) resolves a + // relative specifier against the JS chunk's URL, not the document — so a + // relative "./denoise/" would 404. addModule()/fetch() work with absolute + // too, so this keeps all three asset-load paths consistent. + const fallback = new URL("./denoise/", window.location.href).href; if (!raw) return fallback; try { const u = new URL(raw, window.location.href);