SQLite Forum

incorrect sqlite3-worker1-bundler-friendly.mjs in sqlite-wasm-3430000
Login

incorrect sqlite3-worker1-bundler-friendly.mjs in sqlite-wasm-3430000

(1) By jmull (jjmullaney) on 2023-08-27 22:04:09 [source]

It appears jswasm/sqlite3-worker1-bundler-friendly.mjs is incorrect in the 3.43 release file sqlite-wasm-3430000.zip (currently on the downloads page).

Attempting to load it like this:

new Worker('sqlite3-worker1-bundler-friendly.mjs', { type: 'module' })

results in: TypeError: importScripts cannot be used if worker type is "module"

The problem is that it's an exact copy of sqlite3-worker1.js, which obviously isn't correct.

The workaround is to use the 3.42 version of sqlite3-worker1-bundler-friendly.mjs. This is fine since it doesn't look like any changes to this file are needed for 3.43.

Posting as an FYI in case others run into the same problem (or to get corrections if I'm misunderstanding the situation).

(2) By Stephan Beal (stephan) on 2023-08-28 04:48:59 in reply to 1 [link] [source]

The problem is that it's an exact copy of sqlite3-worker1.js, which obviously isn't correct.

Most definitely not correct and it is reproducible but i'm at a loss to explain it - nothing has changes in those build bits since before the last release, IIRC.

That will be resolved soon. Thank you for the report.

(3) By Stephan Beal (stephan) on 2023-08-28 05:08:39 in reply to 2 [link] [source]

... nothing has changes in those build bits since before the last release, IIRC.

IIRC was apparently not the case. This has been resolved. There won't be a patch release made just for this, but it is in both the current trunk and the 3.43 branch, so will be included in both 3.44 and any 3.43.x patch releases.

Thank you again for the report.

(4) By jmull (jjmullaney) on 2023-08-28 16:00:50 in reply to 3 [link] [source]

Happy to help.

BTW, I noticed the package @sqlite.org/sqlite-wasm was updated to 3.43 and has already been manually patched to fix this issue.

So people using @sqlite.org/sqlite-wasm are good to go.

For people using sqlite-wasm-3430000.zip from the main download page, this provides a convenient source for the corrected file until the fix makes it there: https://github.com/tomayac/sqlite-wasm/blob/0d8e480156ef815757710d1ab6ad595df5c89098/sqlite-wasm/jswasm/sqlite3-worker1-bundler-friendly.mjs

(This is a permalink to the specific version, if I'm operating GitHub correctly.)

(5) By Stephan Beal (stephan) on 2023-08-28 16:13:03 in reply to 4 [link] [source]

BTW, I noticed the package @sqlite.org/sqlite-wasm was updated to 3.43 and has already been manually patched to fix this issue.

That's thanks to the npm maintainer, Thomas Steiner. After your report i notified him about the hotfix and he included it.

This is a permalink to the specific version, if I'm operating GitHub correctly.

For this particular JS file, having a slightly stale copy is not a problem. It's exceedingly unlikely to change, except for maybe docs, before the next release.