sql-js / sql-js/sql.js

sql-wasm.js does not work on Electron-react-app

Open
#446 1 comment 2 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

After I import the sql.js on my electron-react project, I got following error(Cannot set property 'exports' of undefined).
I have checked sql-wasm.js, found the issue.
the Process.versio.node is null on almost react app.
But my app has the correct version.
In this case, the error is caused on sql-wasm.js(row:92).
Currently I have customized the sql-wasm file to use sql.js and avoid this issue.
from
module = undefined
to
module = {
exports: {}
}

so this does work current, but I need the perfect sql.js library.
Please, have a look and fix.
Thanks.

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 inspecting sql-wasm.js around row 92 and reproduce the reported import in an Electron React app, focusing on the null process.version.node case. Done means the library loads without the reported “Cannot set property 'exports' of undefined” error without requiring the described local workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron, javascript, react, wasm
Domain
databases, desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.