Skip to content
This repository was archived by the owner on Jul 1, 2026. It is now read-only.
This repository was archived by the owner on Jul 1, 2026. It is now read-only.

Electron 9 renderer crashes on sqlite module access when reloading the page #1370

Description

@dominic-simplan

Issue Details

  • node-sqlite3 version:
    • 5.0.0
  • Electron Version:
    • 9.2.0
  • Operating System:
    • Windows 10 (1909)

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:

Microsoft (R) Windows Debugger Version 10.0.20153.1000 AMD64
Copyright (c) Microsoft Corporation. All rights reserved.


Loading Dump File [C:\Users\xxx\AppData\Roaming\Electron\Crashpad\reports\99316939-67ae-470c-946b-5b8370ecc606.dmp]
User Mini Dump File: Only registers, stack and portions of memory are available

Symbol search path is: srv*
Executable search path is: 
Windows 10 Version 18362 (900) MP (16 procs) Free x64
Product: WinNt
Edition build lab: Windows NT 10.0.18362.900
Machine Name:
Debug session time: Tue Aug 11 11:35:25.000 2020 (UTC + 2:00)
System Uptime: not available
Process Uptime: 0 days 0:00:10.000
................................................................
.....
This dump file has an exception of interest stored in it.
The stored exception information can be accessed via .ecxr.
(18f0.82f0): Access violation - code c0000005 (first/second chance not available)
For analysis of this file, run !analyze -v
*** WARNING: Unable to verify checksum for ntdll.dll
*** WARNING: Unable to verify checksum for KERNELBASE.dll
ntdll!NtDelayExecution+0x14:
00007ffe`a653c6f4 c3              ret
0:000> !analyze -v
*******************************************************************************
*                                                                             *
*                        Exception Analysis                                   *
*                                                                             *
*******************************************************************************

*** WARNING: Unable to verify checksum for KERNEL32.DLL
*** WARNING: Unable to verify checksum for USER32.dll
*** WARNING: Unable to verify checksum for combase.dll

KEY_VALUES_STRING: 1

    Key  : AV.Fault
    Value: Write

    Key  : Analysis.CPU.mSec
    Value: 984

    Key  : Analysis.DebugAnalysisProvider.CPP
    Value: Create: 8007007e on HU-NB-370

    Key  : Analysis.DebugData
    Value: CreateObject

    Key  : Analysis.DebugModel
    Value: CreateObject

    Key  : Analysis.Elapsed.mSec
    Value: 783

    Key  : Analysis.Memory.CommitPeak.Mb
    Value: 275

    Key  : Analysis.System
    Value: CreateObject

    Key  : Timeline.Process.Start.DeltaSec
    Value: 10

    Key  : WER.Process.Version
    Value: 9.2.0.0


ADDITIONAL_XML: 1

OS_BUILD_LAYERS: 1

NTGLOBALFLAG:  0

PROCESS_BAM_CURRENT_THROTTLED: 0

PROCESS_BAM_PREVIOUS_THROTTLED: 0

CONTEXT:  (.ecxr)
rax=00007ff63763fe20 rbx=00007ffe3236fca8 rcx=000002cb58efddd0
rdx=00007ff637f5dec0 rsi=000002cb58d80460 rdi=000000dc32afb470
rip=00007ff638571b63 rsp=000000dc32afafb8 rbp=000000dc32afb170
 r8=000057570f33940d  r9=0000000000000001 r10=0000000000000000
r11=000000dc32afb010 r12=000057570da6e32d r13=00007ff636e74910
r14=0000000000000000 r15=000002cb58b79070
iopl=0         nv up ei pl nz na pe nc
cs=0033  ss=0000  ds=0000  es=0000  fs=0053  gs=002b             efl=00010202
electron!napi_delete_reference+0x53:
00007ff6`38571b63 48895008        mov     qword ptr [rax+8],rdx ds:00007ff6`3763fe28=8b48ce89484e74c9
Resetting default scope

EXCEPTION_RECORD:  (.exr -1)
ExceptionAddress: 00007ff638571b63 (electron!napi_delete_reference+0x0000000000000053)
   ExceptionCode: c0000005 (Access violation)
  ExceptionFlags: 00000000
NumberParameters: 2
   Parameter[0]: 0000000000000001
   Parameter[1]: 00007ff63763fe28
Attempt to write to address 00007ff63763fe28

PROCESS_NAME:  electron.exe

WRITE_ADDRESS:  00007ff63763fe28 

ERROR_CODE: (NTSTATUS) 0xc0000005 - Die Anweisung in 0x%p verwies auf Arbeitsspeicher bei 0x%p. Der Vorgang %s konnte im Arbeitsspeicher nicht durchgef hrt werden.

EXCEPTION_CODE_STR:  c0000005

EXCEPTION_PARAMETER1:  0000000000000001

EXCEPTION_PARAMETER2:  00007ff63763fe28

STACK_TEXT:  
000000dc`32afafb8 00007ff6`38571b2f     : ffffffff`fffffffe 000002cb`55c44630 00000000`00000009 fffffe10`dceb6d90 : electron!napi_delete_reference+0x53
000000dc`32afafc0 00007ffe`32227503     : 00007ff6`36e74910 00005757`0da6e32d 00006f55`8336d0db 00007ffe`3232a9ec : electron!napi_delete_reference+0x1f
000000dc`32afaff0 00007ff6`36e7490f     : 00005757`0da6e32d 00006f55`8336d0db 00007ffe`3232a9ec ffffffff`fffffffe : node_sqlite3+0x7503
000000dc`32afaff8 00005757`0da6e32d     : 00006f55`8336d0db 00007ffe`3232a9ec ffffffff`fffffffe 00007ffe`3222216b : electron!node_module_register+0x3ff
000000dc`32afb000 00006f55`8336d0db     : 00007ffe`3232a9ec ffffffff`fffffffe 00007ffe`3222216b 00006f55`8336d03b : 0x00005757`0da6e32d
000000dc`32afb008 00007ffe`3232a9ec     : ffffffff`fffffffe 00007ffe`3222216b 00006f55`8336d03b 000000dc`32afb470 : 0x00006f55`8336d0db
000000dc`32afb010 ffffffff`fffffffe     : 00007ffe`3222216b 00006f55`8336d03b 000000dc`32afb470 000000dc`32afb0a0 : node_sqlite3+0x10a9ec
000000dc`32afb018 00007ffe`3222216b     : 00006f55`8336d03b 000000dc`32afb470 000000dc`32afb0a0 000000dc`32afb490 : 0xffffffff`fffffffe
000000dc`32afb020 00006f55`8336d03b     : 000000dc`32afb470 000000dc`32afb0a0 000000dc`32afb490 00007ff6`00000000 : node_sqlite3+0x216b
000000dc`32afb028 000000dc`32afb470     : 000000dc`32afb0a0 000000dc`32afb490 00007ff6`00000000 00000000`00000000 : 0x00006f55`8336d03b
000000dc`32afb030 000000dc`32afb0a0     : 000000dc`32afb490 00007ff6`00000000 00000000`00000000 00006f55`8336d0bb : 0x000000dc`32afb470
000000dc`32afb038 000000dc`32afb490     : 00007ff6`00000000 00000000`00000000 00006f55`8336d0bb 000000dc`32afb400 : 0x000000dc`32afb0a0
000000dc`32afb040 00007ff6`00000000     : 00000000`00000000 00006f55`8336d0bb 000000dc`32afb400 000000dc`32afb0a0 : 0x000000dc`32afb490
000000dc`32afb048 00000000`00000000     : 00006f55`8336d0bb 000000dc`32afb400 000000dc`32afb0a0 00007ffe`3222b0c7 : 0x00007ff6`00000000


SYMBOL_NAME:  electron!napi_delete_reference+53

MODULE_NAME: electron

IMAGE_NAME:  electron.exe

STACK_COMMAND:  dt ntdll!LdrpLastDllInitializer BaseDllName ; dt ntdll!LdrpFailureData ; ~0s ; .ecxr ; kb

FAILURE_BUCKET_ID:  INVALID_POINTER_WRITE_c0000005_electron.exe!napi_delete_reference

OSPLATFORM_TYPE:  x64

OSNAME:  Windows 10

IMAGE_VERSION:  9.2.0.0

FAILURE_ID_HASH:  {95da9ce2-f2eb-0c22-0a13-18146f95472d}

Followup:     MachineOwner
---------

Any ideas what could be the issue?

Activity

  1. mohd-akram commented on Aug 25, 2020

    @mohd-akram
    Contributor

    See if #1368 fixes your issue. You can do npm install mohd-akram/node-sqlite3#fix-segfaults to try the version in the PR.

  2. pamtbaau commented on Oct 22, 2020

    @pamtbaau

    @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, app.allowRendererProcessReuse = false; seems to be a temporary workaround.

  3. mohd-akram commented on Oct 22, 2020

    @mohd-akram
    Contributor

    @pamtbaau You can test with the master branch now npm install mapbox/node-sqlite3. You might need to remove the other version first.

  4. pamtbaau commented on Oct 22, 2020

    @pamtbaau

    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...

  5. pamtbaau commented on Oct 23, 2020

    @pamtbaau

    TL;DR:

    • Patch 5.0.1 doesn't fix reload issue. Reload causes blank window.
    • Compiler generated file napi-v6-win32-x64\node_sqlite3.node while Electron expected napi-v3-win32-x64\node_sqlite3.node. Renaming the file made Electron happy, but reload causes blank window.

    OK, downloaded a few gigs again for Visual Studio, tools and SDK... Took about 90 minutes to finish :-(

    Ran npm install mapbox/node-sqlite3

    Compilation seems to have worked well. File "C:\Users\xxx\Documents\Development\Typescript\Electron\electron-test\node_modules\sqlite3\lib\binding\napi-v6-win32-x64\node_sqlite3.node" has been generated.

    However, Electron throws an error:

    Uncaught Error: Cannot find module 'C:\Users\xxx\Documents\Development\Typescript\Electron\electron-test\node_modules\sqlite3\lib\binding\napi-v3-win32-x64\node_sqlite3.node'
    Require stack:
    - C:\Users\xxx\Documents\Development\Typescript\Electron\electron-test\node_modules\sqlite3\lib\sqlite3-binding.js
    - C:\Users\xxx\Documents\Development\Typescript\Electron\electron-test\node_modules\sqlite3\lib\sqlite3.js
    - C:\Users\xxx\Documents\Development\Typescript\Electron\electron-test\dist\index.html
        at Module._resolveFilename (internal/modules/cjs/loader.js:961)
        at Function.i._resolveFilename (electron/js2c/renderer_init.js:39)
        at Module._load (internal/modules/cjs/loader.js:844)
        at Function.Module._load (electron/js2c/asar.js:769)
        at Module.require (internal/modules/cjs/loader.js:1023)
        at require (internal/modules/cjs/helpers.js:77)
        at Object.<anonymous> (C:\Users\xxx\Documents\Development\Typescript\Electron\electron-test\node_modules\sqlite3\lib\sqlite3-binding.js:4)
        at Object.<anonymous> (C:\Users\xxx\Documents\Development\Typescript\Electron\electron-test\node_modules\sqlite3\lib\sqlite3-binding.js:7)
        at Module._compile (internal/modules/cjs/loader.js:1145)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:1166)
    

    Note that the file generated is: napi-v6-win32-x64\node_sqlite3.node
    While the file requested by Electron is: napi-v3-win32-x64\node_sqlite3.node

    When renaming napi-v6-win32-x64\node_sqlite3.node to napi-v3-win32-x64\node_sqlite3.node, sqlite works fine but reload causes empty window.

  6. mohd-akram commented on Oct 23, 2020

    @mohd-akram
    Contributor

    @pamtbaau Are you also getting a crash like the original post? If so, can you paste the crash log?

  7. pamtbaau commented on Oct 23, 2020

    @pamtbaau

    @mohd-akram,

    Did a fresh npm install. Contrary to my previous test, reload seems to be working most of the time.

    • It seems to go ok every time when using Ctrl+R (10/10)
    • It sometimes (2/10) breaks when reload gets initiated by a rebuild of the app triggering Electron to reload the js/html. After a subsequent change in the code, a reload will succeed.

    When it fails with a blank screen and devtools showing 'DevTools' was disconnected from the page`, the following is printed in the terminal:

    node-pre-gyp info This Node instance does not support builds for N-API version 6
    FATAL ERROR: Error::Error napi_create_reference
     1: 00007FF6FD7345C6 node::Buffer::New+45414
     2: 00007FF6FD734789 node::Buffer::New+45865
     3: 00007FF6FD7345F9 node::Buffer::New+45465
     4: 00007FF6FE598F15 napi_fatal_error+149
     5: 00007FFAB052FDF7
     6: 00007FFAB052CFE2
     7: 00007FFAB0531ECD
     8: 00007FFAB0531B91
     9: 00007FFAB0542633
    10: 00007FF6FE59AC26 napi_ref_threadsafe_function+1254
    11: 00007FF6FE5B62FC uv_translate_sys_error+2380
    12: 00007FF6FD754163 uv_run+307
    13: 00007FF6FD71D0D7 node::EmitAsyncDestroy+85607
    14: 00007FF6FD71D4B6 node::EmitAsyncDestroy+86598
    15: 00007FF6FD70695D node::FreeEnvironment+13
    16: 00007FF6FAAA59D8 v8::OutputStream::WriteHeapStatsChunk+130520
    17: 00007FF6FD609A65 IsSandboxedProcess+2179013
    18: 00007FF6FEE1219F uv_fs_poll_getpath+8729887
    19: 00007FF6FE1208B3 GetHandleVerifier+9953331
    20: 00007FF6FE1A5071 GetHandleVerifier+10495985
    21: 00007FF6FE10C236 GetHandleVerifier+9869750
    22: 00007FF6FE223494 GetHandleVerifier+11013140
    23: 00007FF6FE222F05 GetHandleVerifier+11011717
    24: 00007FF6FE1AD1CE GetHandleVerifier+10529102
    25: 00007FF6FE1AF908 GetHandleVerifier+10539144
    26: 00007FF6FD4B85CE IsSandboxedProcess+797486
    27: 00007FF6FD5FB4E4 IsSandboxedProcess+2120260
    28: 00007FF6FD6140DC IsSandboxedProcess+2221628
    29: 00007FF6FD613F32 IsSandboxedProcess+2221202
    30: 00007FF6FD5FAA04 IsSandboxedProcess+2117476
    31: 00007FF6FE3D0725 GetHandleVerifier+12770981
    32: 00007FF6FB429BD1 std::__1::vector<v8::CpuProfileDeoptFrame,std::__1::allocator<v8::CpuProfileDeoptFrame> >::vector<v8::CpuProfileDeoptFrame,std::__1::allocator<v8::CpuProfileDeoptFrame> >+1643473
    33: 00007FF6FE3D0CDA GetHandleVerifier+12772442
    34: 00007FF6FD04499A uv_cond_signal+1217946
    35: 00007FF6FD88AD74 GetHandleVerifier+951540
    36: 00007FF6FD889061 GetHandleVerifier+944097
    37: 00007FF6FCEEBCBC uv_mutex_unlock+2521420
    38: 00007FF6FD79BCE4 uv_gettimeofday+278804
    39: 00007FF6FD79B9C8 uv_gettimeofday+278008
    40: 00007FF6FD78C23B uv_gettimeofday+214635
    41: 00007FF6FD79C2DE uv_gettimeofday+280334
    42: 00007FF6FCED5B6C uv_mutex_unlock+2430972
    43: 00007FF6FD61B994 IsSandboxedProcess+2252532
    44: 00007FF6FC2C82E1 v8_inspector::V8StackTraceId::ToString+5677153
    45: 00007FF6FD45BB0B IsSandboxedProcess+417899
    46: 00007FF6FB55CDEE v8::CpuProfilingOptions::max_samples+784398
    47: 00007FF6FA93149F Ordinal0+5279
    48: 00007FF7009CEE12 uv_random+16903298
    49: 00007FFAE3917034 BaseThreadInitThunk+20
    50: 00007FFAE3ABCEC1 RtlUserThreadStart+33
    
  8. mohd-akram commented on Oct 23, 2020

    @mohd-akram
    Contributor

    You need to build the package for electron since there aren't prebuilt binaries. See the instructions here. Try running:

    npm install --save-dev electron-rebuild
    # Every time you run "npm install", run this:
    ./node_modules/.bin/electron-rebuild
    
  9. pamtbaau commented on Oct 23, 2020

    @pamtbaau

    Hm, I'm confused... I have in my package.json "postinstall": "electron-builder install-app-deps" and VC++ is being called when running npm install mapbox/node-sqlite3

    To quote electron-builder:

    To ensure your native dependencies are always matched electron version, simply add script "postinstall": "electron-builder install-app-deps" to your package.json.

    Output running npm install mapbox/node-sqlite3:

    > sqlite3@5.0.1 install C:\Users\xxx\Documents\Development\Typescript\Electron\electron-test\node_modules\sqlite3
    > node-pre-gyp install --fallback-to-build
    
    node-pre-gyp WARN Using request for node-pre-gyp https download
    node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.1/napi-v6-win32-x64.tar.gz
    node-pre-gyp WARN Pre-built binaries not found for sqlite3@5.0.1 and node@14.14.0 (node-v83 ABI, unknown) (falling back to source compile with node-gyp)
    Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
      nothing.c
      win_delay_load_hook.cc
      nothing.vcxproj -> C:\Users\xxx\Documents\Development\Typescript\Electron\electron-test\node_modules\sqlite3\build\Release\\nothing
      .lib
      unpack_sqlite_dep
      sqlite3.c
      win_delay_load_hook.cc
      sqlite3.vcxproj -> C:\Users\xxx\Documents\Development\Typescript\Electron\electron-test\node_modules\sqlite3\build\Release\\sqlite3
      .lib
      backup.cc
      database.cc
      node_sqlite3.cc
      statement.cc
      win_delay_load_hook.cc
         Creating library C:\Users\xxx\Documents\Development\Typescript\Electron\electron-test\node_modules\sqlite3\build\Release\node_sq
      lite3.lib and object C:\Users\xxx\Documents\Development\Typescript\Electron\electron-test\node_modules\sqlite3\build\Release\node_s
      qlite3.exp
      node_sqlite3.vcxproj -> C:\Users\xxx\Documents\Development\Typescript\Electron\electron-test\node_modules\sqlite3\build\Release\\no
      de_sqlite3.node
      Copying C:\Users\xxx\Documents\Development\Typescript\Electron\electron-test\node_modules\sqlite3\build\Release\/node_sqlite3.node
      to C:/Users/xxx/Documents/Development/Typescript/Electron/electron-test/node_modules/sqlite3/lib/binding/napi-v6-win32-x64\node_sql
      ite3.node
              1 file(s) copied.
    n
    

    I'll try your suggestion though....

  10. pamtbaau commented on Oct 23, 2020

    @pamtbaau

    Even more confused...

    • Removed electron-builder
    • Removed script "postinstall": "electron-builder install-app-deps"
    • Installed electron-rebuild
    • Run npm install mapbox/node-sqlite3
      • Compiler is being called and binding/napi-v6-win32-x64\node_sqlite3.node is being generated
    • Running npx electron-rebuild throws errors. See below.

    Another try:

    • Removed node-modules
    • Run npm install
      • Compiler is being called
      • All is well
    • Run npx electron-rebuild
      • Same errors being thrown.

    Errors during compilation using npx electron-rebuild

    \ Building module: sqlite3, Completed: 0Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
                                              nothing.c
    - Building module: sqlite3, Completed: 0  win_delay_load_hook.cc
    - Building module: sqlite3, Completed: 0  nothing.vcxproj -> C:\Users\xxx\Documents\Development\Typescript\Electron\electron-test\node_modules\sqlite3\build\Release\\nothing.lib
    \ Building module: sqlite3, Completed: 0  unpack_sqlite_dep
    - Building module: sqlite3, Completed: 0  sqlite3.c
    | Building module: sqlite3, Completed: 0  win_delay_load_hook.cc
    | Building module: sqlite3, Completed: 0  sqlite3.vcxproj -> C:\Users\xxx\Documents\Development\Typescript\Electron\electron-test\node_modules\sqlite3\build\Release\\sqlite3.lib
    - Building module: sqlite3, Completed: 0  backup.cc
    | Building module: sqlite3, Completed: 0c:\users\xxx\documents\development\typescript\electron\electron-test\node_modules\node-addon-api\napi-inl.h(752): error C3861: 'napi_create_bigint_int64': identifier not found [C:
    \Users\xxx\Documents\Development\Typescript\Electron\electron-test\node_modules\sqlite3\build\node_sqlite3.vcxproj]
    c:\users\xxx\documents\development\typescript\electron\electron-test\node_modules\node-addon-api\napi-inl.h(759): error C3861: 'napi_create_bigint_uint64': identifier not found [C
    :\Users\xxx\Documents\Development\Typescript\Electron\electron-test\node_modules\sqlite3\build\node_sqlite3.vcxproj]
    c:\users\xxx\documents\development\typescript\electron\electron-test\node_modules\node-addon-api\napi-inl.h(766): error C3861: 'napi_create_bigint_words': identifier not found [C:
    \Users\xxx\Documents\Development\Typescript\Electron\electron-test\node_modules\sqlite3\build\node_sqlite3.vcxproj]
    c:\users\xxx\documents\development\typescript\electron\electron-test\node_modules\node-addon-api\napi-inl.h(779): error C3861: 'napi_get_value_bigint_int64': identifier not found
    [C:\Users\xxx\Documents\Development\Typescript\Electron\electron-test\node_modules\sqlite3\build\node_sqlite3.vcxproj]
    c:\users\xxx\documents\development\typescript\electron\electron-test\node_modules\node-addon-api\napi-inl.h(787): error C3861: 'napi_get_value_bigint_uint64': identifier not found
     [C:\Users\xxx\Documents\Development\Typescript\Electron\electron-test\node_modules\sqlite3\build\node_sqlite3.vcxproj]
    c:\users\xxx\documents\development\typescript\electron\electron-test\node_modules\node-addon-api\napi-inl.h(795): error C3861: 'napi_get_value_bigint_words': identifier not found
    [C:\Users\xxx\Documents\Development\Typescript\Electron\electron-test\node_modules\sqlite3\build\node_sqlite3.vcxproj]
    c:\users\xxx\documents\development\typescript\electron\electron-test\node_modules\node-addon-api\napi-inl.h(802): error C3861: 'napi_get_value_bigint_words': identifier not found
    [C:\Users\xxx\Documents\Development\Typescript\Electron\electron-test\node_modules\sqlite3\build\node_sqlite3.vcxproj]
    × Rebuild Failed
    
    An unhandled error occurred inside electron-rebuild
    node-gyp failed to rebuild 'C:\Users\xxx\Documents\Development\Typescript\Electron\electron-test\node_modules\sqlite3'.
    Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
    
    
    
    Error: node-gyp failed to rebuild 'C:\Users\xxx\Documents\Development\Typescript\Electron\electron-test\node_modules\sqlite3'.
    Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
    
    
        at ModuleRebuilder.rebuildNodeGypModule (C:\Users\xxx\Documents\Development\Typescript\Electron\electron-test\node_modules\electron-rebuild\lib\src\module-rebuilder.js:193:19)
        at processTicksAndRejections (internal/process/task_queues.js:93:5)
        at async Rebuilder.rebuildModuleAt (C:\Users\xxx\Documents\Development\Typescript\Electron\electron-test\node_modules\electron-rebuild\lib\src\rebuild.js:183:9)
        at async Rebuilder.rebuild (C:\Users\xxx\Documents\Development\Typescript\Electron\electron-test\node_modules\electron-rebuild\lib\src\rebuild.js:145:17)
        at async C:\Users\xxx\Documents\Development\Typescript\Electron\electron-test\node_modules\electron-rebuild\lib\src\cli.js:145:9
    
  11. pamtbaau commented on Nov 4, 2020

    @pamtbaau

    @mohd-akram , Any news on this issue you could share?

  12. mohd-akram commented on Nov 4, 2020

    @mohd-akram
    Contributor

    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.

  13. pamtbaau commented on Nov 4, 2020

    @pamtbaau

    Was using node v14.x and downgraded to v12.16.3.

    Steps:

    • Removed /node_modules
    • Reinstalled all dependencies
      • Using "sqlite3": "github:mapbox/node-sqlite3"
      • NB. No Visual Studio compiler, nor Python available.
    • Starting Electron app goes well
    • Reload fails
    • Add app.allowRendererProcessReuse = false; to index.js and reload succeeds.
  14. mohd-akram commented on Nov 4, 2020

    @mohd-akram
    Contributor

    How did the install complete without a compiler?

  15. pamtbaau commented on Nov 4, 2020

    @pamtbaau

    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 npm install:

    [stuff omitted]
    
    > sqlite3@github:mapbox/node-sqlite3#833f5cc1332b9213a17873f42a3d3a18dca5afc1 install C:\Users\xxx\Documents\Development\Typescript\Electron\electron-test\node_modules\sqlite3
    > node-pre-gyp install --fallback-to-build
    node-pre-gyp WARN Using request for node-pre-gyp https download
    [sqlite3] Success: "C:\Users\xxx\Documents\Development\Typescript\Electron\electron-test\node_modules\sqlite3\lib\binding\napi-v3-win32-x64\node_sqlite3.node" is installed via remote
    
    [stuff omitted]
    
    > electron-builder install-app-deps
    
      • electron-builder  version=22.9.1
      • loaded configuration  file=package.json ("build" field)
      • rebuilding native dependencies  dependencies=sqlite3@5.0.1 platform=win32 arch=x64
    
  16. 14 remaining items

  17. pamtbaau commented on Feb 16, 2021

    @pamtbaau

    @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 app.allowRendererProcessReuse = false.

    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.

  18. itsUndefined commented on Mar 4, 2021

    @itsUndefined

    My app crashes when reloading even when using sqlite3@5.0.2 if I don't set app.allowRendererProcessReuse = false. Electron version is 11.3.0. For sure this is not fixed.

  19. itsUndefined commented on Mar 4, 2021

    @itsUndefined

    Nevermind. The issue has to do with the rollback of n-api 6. Version 5.0.1 works fine.

  20. kewde commented on Mar 9, 2021

    @kewde
    Collaborator

    I'm sorry for the issues, I will look at re-enabling N-API 6 as soon as possible.

  21. added this to the 5.0.3 milestone on Mar 9, 2021
  22. ddcado commented on May 19, 2021

    @ddcado

    Hi,
    I had the same bug, I m learning Node JS, electron, I wanted to do an app just to learn,
    I read a lot of things, and I think there is two way:

    • If you use the renderer to connect your databas, you need to open a new window wich you will close and open a new one etc..., there is no crash then... You crash only if you reload your BrowserWindow nearly after the first use....
    • If You use the main process to connect to your DB, there is no crash if you have rebuild sqlite3

    In both case, you need to use IpcMain / ipcRenderer...
    I tried both and I had no crash then...
    I hope someone will find the BUG with sqlite and the renderer.
    Good luck and good job.
    Edit: seems to be a security reason on chrome

  23. pdesantis commented on Jun 24, 2021

    @pdesantis
    Contributor

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

  24. bojanbizjak commented on Sep 8, 2021

    @bojanbizjak

    Same issue (app crashes on reload):

    electron: 14.0.0
    sqlite3: 5.0.2
    websql: 2.0.3

    We use sqlite3 in renderer process.

    It's working (app reloads) on electron: 13.3.0 with app.allowRendererProcessReuse = false

  25. dominic-simplan commented on Oct 6, 2021

    @dominic-simplan
    Author
  26. sarahmolinerroy commented on Oct 15, 2021

    @sarahmolinerroy

    @kewde I see you tagged this issue for the next patch version 5.0.3. Is it possible to know the expected release date for this? It is preventing us from upgrading to Electron 14 and up. Happy to help test if we can. Thanks for looking into this!

  27. jbcullis commented on Nov 15, 2021

    @jbcullis

    @kewde Same issue here.
    electron 15.3.1
    sqlite3: 5.0.2

    Resolved by downgrading to electron 13.3 and setting allowRendererProcessReuse to false.

  28. daniellockyer commented on Apr 15, 2022

    @daniellockyer
    Contributor

    Would you be able to try with v5.0.3 please? 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions