From eb0357253c94d4e434c5a5e5a0248fbfdca1cccb Mon Sep 17 00:00:00 2001 From: Jaime Idolpx Date: Sun, 14 Jun 2026 21:23:38 -0400 Subject: [PATCH] fix(locate-db): update WASM URL import to use Vite's hashed asset path --- src/app/locate-db.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/locate-db.ts b/src/app/locate-db.ts index 0957186..5dadd5a 100644 --- a/src/app/locate-db.ts +++ b/src/app/locate-db.ts @@ -1,10 +1,11 @@ import sqlite3InitModule from '@sqlite.org/sqlite-wasm'; +import wasmUrl from '@sqlite.org/sqlite-wasm/sqlite3.wasm?url'; import { getWebDAVBaseUrl, basename, listDirectory, putFileContents, deletePath } from './webdav'; const LOCATE_PATH = '/sd/.locate'; -// Resolved against import.meta.url so it works under any Vite base path -// (/, /config/, etc.) the same way the sqlite-wasm library resolves it. -const WASM_URL = new URL('sqlite3.wasm', import.meta.url).toString(); +// Vite rewrites this `?url` import to the hashed asset path +// (e.g. /assets/sqlite3-BVKGSWc-.wasm) and respects the configured base path. +const WASM_URL: string = wasmUrl; function parseContentLength(header: string | null): number | null { if (!header) return null;