Skip to content

ambiguous indirect export: SqliteClient #27

@MigFerreira

Description

@MigFerreira

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions