sql-js / sql-js/sql.js

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

未关闭
#446 1 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
JavaScript
星标
13.7k
派生
1.1k
PR 合并指标
30 天内没有已合并 PR

描述

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.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

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.

由索引模型根据 Issue 内容生成。

评估

技术栈
electron, javascript, react, wasm
领域
databases, desktop
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。