Skip to content

Loading worker #29

@MigFerreira

Description

@MigFerreira

Was having some trouble getting worker path working with vite, ran into this:
https://stackoverflow.com/questions/67995082/how-to-create-web-worker-in-a-sveltekit-app-on-vercel

Basically I got it working this way:

const sqliteWorkerPath = new URL('./sqlite-worker.mjs', import.meta.url).href
const filename = '/mydb.sqlite3';
const sqlite = new SqliteClient(filename, sqliteWorkerPath);

Problem right now I believe is with how vite manages imports, since im getting the following error:

[vite] Internal server error: Missing "./src/comlink.mjs" specifier in "@sqlite.org/sqlite-wasm" package
  Plugin: vite:import-analysis
  File: /home/mitch/Projects/supertokens-poc/src/lib/db/sqlite-worker.mjs

Ill be trying to tackle this but if anyone wants to help out: https://stackblitz.com/edit/sveltejs-kit-template-default-ubkpkr

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