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:

  1. use npx create-electron-app --template="webpack to create/initialize a fresh new electron app with ElectronForge.
  2. Now execute npm install better-sqlite3.
  3. Require better-sqlite3 in your main.js file: (let db = require(“better-sqlite3”)😉
  4. Now execute npm start and observe.
  5. 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)

@JoshuaWise

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 33 (10 by maintainers)

Commits related to this issue

Most upvoted comments

I’ve encountered this issue with Electron 26 & better-sqlite3 v8.5.x. Going to see which downgrade works again 😦

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 variable npm_config_build_from_source=true, but using the currently-released version (6.0.1), I still got

(node:2357177) UnhandledPromiseRejectionWarning: Error: The module '/tmp/.mount_PhotoS9hayLP/resources/app.asar.unpacked/node_modules/better-sqlite3/build/Release/better_sqlite3.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 89. This version of Node.js requires
NODE_MODULE_VERSION 98. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).

I 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 for 14, not a single 89. 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:

better-sqlite3-v7.4.3-electron-v89-linux-x64.tar.gz

Future?

better-sqlite3-v7.4.3-electron-v13-linux-x64.tar.gz
better-sqlite3-v7.4.3-electron-v14-linux-x64.tar.gz

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:

I am not sure if the issue is with better-sqlite3 or with the build tools used with electron.

– You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/JoshuaWise/better-sqlite3/issues/694#issuecomment-916997741

Yes bro, I tried with 7.4.0. It works fine. @JoshuaWise Any update on this?

@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 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 or electron-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.