sql-js / sql-js/sql.js

Electron package related bug when load wasm file

Open
#535 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
13.7k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

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)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the filename normalization shown in the issue and how fs.readFile handles file:/// paths in an Electron package. Review the linked Emscripten pull request to determine whether the fix belongs upstream or in sql.js. Done means the packaged demo.wasm path loads correctly without the reported ENOENT error.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron, javascript, wasm
Domain
build-system, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.