ambiguous indirect export: SqliteClient
MigFerreira opened this issue · 1 comments
MigFerreira commented
As Im using this wrapper with SvelteKit, to guarantee its loaded only on client side I set it up on view with:
page.svelte:
import { onMount } from 'svelte';
onMount(async () => {
const sqlite = await import('$lib/db');
});
wheres lib/db/index.js:
import { SqliteClient } from '@sqlite.org/sqlite-wasm';
// Must correspond to the path in your final deployed build.
const sqliteWorkerPath = '$lib/db/sqlite-worker.js';
// This is the name of your database. It corresponds to the path in the OPFS.
const filename = '/mydb.sqlite3';
const sqlite = new SqliteClient(filename, sqliteWorkerPath);
await sqlite.init();
This is causing error: Uncaught (in promise) SyntaxError: ambiguous indirect export: SqliteClient
Possible solution:
I was able to solve this by removing default from sqlite-client.mjs in the wrapper source.
tomayac commented
Thank you, fixed in @sqlite.org/sqlite-wasm@3.42.0-build6
.