sql.js
sql.js copied to clipboard
Electron package related bug when load wasm file
The original code filename = nodePath'normalize'; is buggy when using it used with electron package. fs.readFile will take this to a wrong path on electron packaged. For exmaple: I have a packaged file path "'file:///C:/**/resources/app/dist/demo.wasm", fs.readFile will throw a error like: "Error: ENOENT: no such file or directory, open 'C::\C:\resources\app\dist\demo.wasm"
Actually it's a bug with emscripten, I have created a pull request for emscripten https://github.com/emscripten-core/emscripten/pull/18226)
it's fixed in emscripten (https://github.com/emscripten-core/emscripten/pull/17915). Maybe should sync to this project since these code is strongly related.