-
-
Notifications
You must be signed in to change notification settings - Fork 393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Electron app crashing with latest better-sqlite3 #1062
Comments
Did you clean up the node_modules folder? Node Module Version 116 belongs to Electron 25 / 26, not 24. Due to a shortcoming in how prebuild handles the node module version when resolving package names, this current leads to issues when using Electron 26 with the prebuilt binaries #1044 (comment). |
Yes. I always remove the node_modules and package-lock before doing npm install.
I am not sure if the same happens for older versions as well. I am using Electron 24.1.2 and I couldn't find any issues which mention the error for this version in Electron repo. I am also not using prebuilt binaries in my case. Just using electron-rebuild to rebuild better-sqlite3, then packaging it using electron-forge. |
Well if you still get the error
something on your machine did either resolve the wrong prebuilt binary or you are really executing with Electron 25 / 26. I just downgraded a project to Electron 24.1.2 for testing purposes and had no issues when installing [email protected] aswell as on a fresh project. As I am using electron-builder for the native module part, I tend to suspect electron-rebuild maybe not doing what it should. |
Ohhk. Thank you so much for testing it yourself @neoxpert. I'll try the same with electron-builder (hoping it won't require big changes) and see if it's an issue with electron-rebuild. |
I lowered it to 25.8.1 with no problem, but I couldn't upgrade to 26.x |
Saved my life |
It is now available to support 26.x 27.x requires 9.0.0 |
I was having a similar issue to @jayakrishnankp , and fixed it by updating my mac to a newer version of OSX. In my case, the root cause of:
was due to a darwin binary being loaded that is not compatible with my current operating system. I bisected versions down to v8.5.2, which added darwin-arm64 prebuilds. Unfortunately, it seems that |
I was using better-sqlite3 with the version as
^8.3.0
in package.json in my electron app for some time.On a recent
npm install
, better-sqlite3 version 8.6.0 was installed, which causes my app to crash with an error message:NOTE: When I switch my version back to
8.4.0
or less, everything works fineSteps to Reproduce
better-sqlite3
in main.js and initialize the db:npm run start
Versions
Expected behaviour
No error and the console log is expected
Addition Context
The crash happens at the bit of code which creates the new db file:
The text was updated successfully, but these errors were encountered: