-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
I am creating a PWA that is reading a static database. I am including the wasm file in the bundle.
In SvelteKit, the src/routes/route_name/+page.ts is where data is loaded for the route.
I have:
import { base } from '$app/paths';
import initSqlJs from 'sql.js';
export async function load({ fetch }) {
const SQL = await initSqlJs({
locateFile: (file: string) => `${base}/wasm/${file}`
});
...
}
When I run this, I get this error with SvelteKit in the console:
Loading /wasm/sql-wasm.wasm using
window.fetch. For best results, use thefetchthat is passed to yourloadfunction: https://svelte.dev/docs/kit/load#making-fetch-requests
How can I have initSqlJs use a provided fetch function to request the file instead of window.fetch ?
Metadata
Metadata
Assignees
Labels
No labels