Open shamrin opened 3 years ago
Yes, this could be nice, and simplify our old build process. Are you interested in making a PR ?
I'm thrilled to hear that this was fixed in Emscripten directly. I've been out of this project for a while, but am dipping my toes back in and can take a look if no one beats me to it.
I don't know how the bug was originally triggered, but I tried adding -s MODULARIZE=1
to the emcc flags, changed the output filename to end with .mjs (to output an ES6 module which I prefer), and removed the custom bundling.
Then to load the module in my page I did:
import initSqlJs from '../dist/sql-idb-wasm.mjs';
initSqlJs().then(async SQL => {
...
It seems to work. I'm using emsdk 2.0.16. Again, I don't know if I'm exercising the problem path.
The generated code in
sql-wasm.js
mentions Emscripten issue: emscripten-core/emscripten#5820.This issue was fixed in PR emscripten-core/emscripten#10697 and released as version 13.9.16 in May 2020.
I think removing manual modularization will simplify sql.js build process.