-
-
Notifications
You must be signed in to change notification settings - Fork 815
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 9 renderer crashes on sqlite module access when reloading the page #1370
Comments
See if #1368 fixes your issue. You can do |
@mohd-akram, Wanted to test above mentioned fix, but it has been removed. And 5.0.1 isn't released yet... Any update on failing reload of renderer? By the way, in the meantime, |
@pamtbaau You can test with the master branch now |
Darn, just removed Visual Studio and Python because of limited diskspace... And no pre-built binaries for sqlite3@5.0.1 and node@14.14.0 yet... |
TL;DR:
OK, downloaded a few gigs again for Visual Studio, tools and SDK... Took about 90 minutes to finish :-( Ran Compilation seems to have worked well. File However, Electron throws an error:
Note that the file generated is: When renaming |
@pamtbaau Are you also getting a crash like the original post? If so, can you paste the crash log? |
Did a fresh
When it fails with a blank screen and devtools showing 'DevTools' was disconnected from the page`, the following is printed in the terminal:
|
You need to build the package for electron since there aren't prebuilt binaries. See the instructions here. Try running:
|
Hm, I'm confused... I have in my package.json To quote electron-builder:
Output running
I'll try your suggestion though.... |
Even more confused...
Another try:
Errors during compilation using
|
@mohd-akram , Any news on this issue you could share? |
I think the issue is that the Node.js version you have installed is newer than the Electron one. What Node.js version are you using? I encountered a similar thing while working on #1367 (see #1367 (comment)) and had to set the Node.js versions of the CI to match Electron. I guess you could confirm this by using something like nvm - you'd need to use a version of Node.js < 12.17.0. I'm not sure what the workaround would be to build locally for newer versions, but it should work once 5.0.1 is released and pre-built binaries are available. |
Was using node v14.x and downgraded to v12.16.3. Steps:
|
How did the install complete without a compiler? |
You may call me stupid, but I just don't know what is going on under the hood... This is a section form the output of
|
It says "rebuilding native dependencies" and it seems to be using the correct napi version this time (v3). Perhaps you have the build tools installed. Does |
I cannot find any references to VS compiler, SDK's etc on disk nor in control panel or settings/apps.
|
@mohd-akram Installed Python and VS Studio again... TLDR; Two scenarios tested:
Env:
package.json
angular app.component
|
Hello, I also had troubles in reload-error. Version information Problem code const db = require('sqlite3').verbose(); // <-- Error was occurred in this line when reloading. Solution By following your ideas, I added the code, and now it works. Discussion |
@vortrefflich, Also, be advised that you might see an accumulation of Electron processes by setting |
Dear @pamtbaau. As a result,
Reference |
@vortrefflich, I did test 5.0.1 and downgraded Node as suggested, but no success... Issue remains. Which OS are you using? |
@pamtbaau, I installed all the modules as latest version. My computer works in Win10 x64. |
@vortrefflich, Still cannot get it to work... If it is not too much asked, would you mind trying a minimal Electron/Angular/Sqlite repo I've created? Or, if you have got a repo I can test, that will be fine too. |
Dear @pamtbaau,
TEST 2 - to solve napi-v3-win32-x64 error.
Conclusion - The "node_sqlite3.node" file should be installed into "node_modules/sqlite3/lib/binding/napi-v6-win32-x64" |
@vortrefflich, Thanks for the time and effort spent to test my sample repo. I appreciate it. Curious about the differences between your two machines... Tried jumping several hoops again, but no success. In the mean time, I'll stick to NB. Your conclusion seems to contradict the result of the succeeded computer which generated |
@pamtbaau, |
Just tested with It must be installed via Optionally you can run Environment:
|
I have seen such as crash in VSCode when trying to adopt latest SQLite, whenever I close VSCode, a crash would occur. Ever since we updated to Electron 11 though, I cannot reproduce the crash anymore. Stack:
|
@MatteoMeil, Do you perhaps have a minimal test project I can download? I cannot get my Angular/Electron/Sqlite app to work, unless when using Also, does reloading you app work consistently? My app may work 5-10 times and then fail over and over again. After a rebuild, it might not work at all. |
My app crashes when reloading even when using sqlite3@5.0.2 if I don't set |
Nevermind. The issue has to do with the rollback of n-api 6. Version 5.0.1 works fine. |
I'm sorry for the issues, I will look at re-enabling N-API 6 as soon as possible. |
Hi,
In both case, you need to use IpcMain / ipcRenderer... |
@kewde thanks for looking into this! Do you by any chance have a sense on if this will ship in the next month? No worries if not, I'm just trying to decide whether or not I should invest in a short-term fix in my app if the package will be updated soon. |
Same issue (app crashes on reload): electron: 14.0.0 We use sqlite3 in renderer process. It's working (app reloads) on electron: 13.3.0 with app.allowRendererProcessReuse = false |
Electron 14 removed the app.allowRendererProcessReuse option. |
@kewde I see you tagged this issue for the next patch version |
@kewde Same issue here. Resolved by downgrading to electron 13.3 and setting allowRendererProcessReuse to false. |
Would you be able to try with v5.0.3 please? 🙂 |
Issue Details
Actual Behavior
Since Electron 9 (tried with 9.1.2 and 9.2) seems like the renderer process (?) crashes when using the reload function. Initial loading of the page works fine, but when reloading, the page stays completely white and the DevTools report that it was disconnected from the page.
This seems to be related to the Electron flag
allowRendererProcessReuse
and this change in Electron. Since Electron 9,allowRendererProcessReuse
is set to true by default. Switching it manually back to false fixes the described issue.Looking at the crash dump (see below) and according to this comment on the Electron ticket I've created this seems to be related to the native sqlite module.
Here is the output of the crash dump with WinDbg:
Any ideas what could be the issue?
The text was updated successfully, but these errors were encountered: