better-sqlite3: App is throwing the error while running electron 14.0.0 and better-sqlite3
Description: I’m using electron 14.0.0 and latest version of better-sqlite3 package. However, when I try to run my app I get the following error: Compiling Renderer Code[13984:0903/144946.475:ERROR:crashpad_client_win.cc(808)] not connected And my app exits. Steps to reproduce:
- use
npx create-electron-app --template="webpack
to create/initialize a fresh new electron app with ElectronForge. - Now execute
npm install better-sqlite3
. - Require better-sqlite3 in your main.js file: (let db = require(“better-sqlite3”)😉
- Now execute npm start and observe.
- The app will throw the error such as: Compiling Renderer Code[13984:0903/144946.475:ERROR:crashpad_client_win.cc(808)] not connected
(This error doesn’t come if we use Electron 13.3.0)
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 33 (10 by maintainers)
Commits related to this issue
- Upgrade depencies Addresses #692 and #694 — committed to mceachen/better-sqlite3 by mceachen 3 years ago
- Upgrade depencies (#702) Addresses #692 and #694 — committed to WiseLibs/better-sqlite3 by mceachen 3 years ago
I just got the same issue with Electron 26.1.0. Had to downgrade to 25.4.0 and it worked again.
@JoshuaWise I poked at this a bit just now.
prebuild-install
can be forced to rebuild by setting the environment variablenpm_config_build_from_source=true
, but using the currently-released version (6.0.1), I still gotI cloned better-sqlite3 into a local directory, ran
npx ncu -u
which pulled in"prebuild-install": "^6.1.4"
, changed my package.json to point to that new directory, and everything looks good.TL;DR: please upgrade your
prebuild-install
dependency. #702 should take care of it.(Also, TIL that
prebuild
now recommends transitioning to prebuildify paired with node-gyp-build. More context here)@akash07k have you tried using v7.4.0? That is the last version that works for me. If the reason is a node mismatch then probably versions beyond 7.4.0 will not work in lower versions of electron either.
I might be entirely lost, but maybe this is related to the fact that both Electron 13 and 14 use ABI 89. That means it pulls the prebuild for ABI 89 but it was compiled for Electron 13. The prebuilds need to be for a given Electron version, not ABI version. There needs to be a prebuild for
13
AND for14
, not a single89
. Does that make sense? Maybe this was the first Electron major release without ABI bump, at least since better-sqlite3 has prebuilds (see https://github.com/electron/node-abi/blob/master/abi_registry.json).Edit:
Currently:
Future?
But I don’t really know a lot about this. Maybe the ABI version is the only thing relevant for compatibility? If so, then why doesn’t it work?
Version 7.4.5 works for me. Thanks!
yeah
On 9/10/21, Alexander Gabriel @.***> wrote:
Yes bro, I tried with 7.4.0. It works fine. @JoshuaWise Any update on this?
I can reproduce this with a vanilla project as well (without all the bells and whistles of create-electron-app). This error seems to come up frequently with other native modules as well https://github.com/search?o=desc&q=_ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEiNS_19ConstructorBehaviorENS_14SideEffectTypeE&s=&type=Issues
I am kind of confused, because I can’t seem to make
npm rebuild
orelectron-rebuild
actually make it rebuild from scratch. And since there is no prebuild for Electron 14 I have no idea what it’s actually installing?So I’m not sure on which end this needs to be fixed.