sqlite / sqlite-wasm

SQLite Wasm conveniently wrapped as an ES Module.
580 stars 47 forks source link

Bug: Can't resolve './sqlite-wasm/jswasm/sqlite3-worker1-promiser-bundler-friendly.js' #58

Closed piotrblasiak closed 10 months ago

piotrblasiak commented 10 months ago

Was working fine in 3.44.2-build1, but when updating to 3.44.2-build2:

ERROR in ./node_modules/@sqlite.org/sqlite-wasm/index.mjs 2:0-75 Module not found: Error: Can't resolve './sqlite-wasm/jswasm/sqlite3-worker1-promiser-bundler-friendly.js' in '/node_modules/@sqlite.org/sqlite-wasm' resolve './sqlite-wasm/jswasm/sqlite3-worker1-promiser-bundler-friendly.js' in '/node_modules/@sqlite.org/sqlite-wasm' using description file: /node_modules/@sqlite.org/sqlite-wasm/package.json (relative path: .) Field 'browser' doesn't contain a valid alias configuration using description file: /node_modules/@sqlite.org/sqlite-wasm/package.json (relative path: ./sqlite-wasm/jswasm/sqlite3-worker1-promiser-bundler-friendly.js) Field 'browser' doesn't contain a valid alias configuration

/node_modules/@sqlite.org/sqlite-wasm/sqlite-wasm/jswasm/sqlite3-worker1-promiser-bundler-friendly.js doesn't exist
jlarmstrongiv commented 10 months ago

I have a similar error, when using SQLite3 wasm in a web worker with Astro (based on Vite)

 building client (vite) 
21:16:47 [vite] transforming...
Error: 7 [ERROR] [vite] [vite:worker-import-meta-url] Could not resolve "./sqlite-wasm/jswasm/sqlite3-bundler-friendly.mjs" from "../../../node_modules/@sqlite.org/sqlite-wasm/index.mjs"
21:16:47 [vite] ✓ 81 modules transformed.
file: /home/runner/actions-runner/_work/project/project/packages/core/src/astro/workers/astro/Sqlite3Worker.astro?astro&type=script&index=0&lang.ts
Could not resolve "./sqlite-wasm/jswasm/sqlite3-bundler-friendly.mjs" from "../../../node_modules/@sqlite.org/sqlite-wasm/index.mjs"
  Stack trace:
    at error (file:///home/runner/actions-runner/_work/project/project/node_modules/rollup/dist/es/shared/parseAst.js:337:30)
    at file:///home/runner/actions-runner/_work/project/project/node_modules/rollup/dist/es/shared/node-entry.js:17932:26
npm ERR! Lifecycle script `build` failed with error: 
npm ERR! Error: command failed 
npm ERR!   in workspace: project@0.0.0 
npm ERR!   at location: /home/runner/actions-runner/_work/project/project/packages/astro/project 

Downgrading to 3.44.2-build1 for now

tomayac commented 10 months ago

Sorry, I have just released 3.44.2-build3 that fixes this. It makes the download parser a lot more stable via https://github.com/sqlite/sqlite-wasm/commit/178194009750cad225ed9208cc3917e3d0c43b18.

jlarmstrongiv commented 9 months ago

Thank you! That fix works great 👍