Repository navigation
Closed
Labels
Description
Hi there,
when upgrading to Electron 20, better-sqlite3 does not build any longer.
On macOS, I get the following error:
CXX(target) Release/obj.target/better_sqlite3/src/better_sqlite3.o
./src/util/macros.lzz:157:21: error: no member named 'AccessorSignature' in namespace 'v8'
v8::AccessorSignature::New(isolate, recv)
~~~~^
./src/objects/database.lzz:180:21: warning: variable 'status' set but not used [-Wunused-but-set-variable]
int status = sqlite3_db_config(db_handle, SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION, 1, NULL);
^
./src/util/binder.lzz:37:51: error: no member named 'CreationContext' in 'v8::Object'
v8::Local<v8::Context> ctx = obj->CreationContext();
~~~~~^
On Windows (using Visual Studio 2017), I get the following:
c:\users\...\.electron-gyp\20.0.3\include\node\v8-callbacks.h(221): error C2062: type 'int' unexpected
c:\users\...\.electron-gyp\20.0.3\include\node\v8-callbacks.h(335): error C2062: type 'int' unexpected
c:\users\...\.electron-gyp\20.0.3\include\node\v8-isolate.h(292): error C3646: 'legacy_oom_error_callback': unknown override specifier
c:\users\...\.electron-gyp\20.0.3\include\node\v8-isolate.h(292): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\users\...\.electron-gyp\20.0.3\include\node\v8-isolate.h(1482): error C2061: syntax error: identifier 'LegacyOOMErrorCallback'
c:\users\...\.electron-gyp\20.0.3\include\node\v8-isolate.h(1545): error C2061: syntax error: identifier 'WasmDynamicTieringEnabledCallback'
c:\users\...\.electron-gyp\20.0.3\include\node\v8-initialization.h(290): error C2061: syntax error: identifier 'LegacyOOMErrorCallback'
c:\...\node_modules\better-sqlite3\build\src\objects\database.lzz(453): warning C4309: 'static_cast': truncation of constant value
c:\...\node_modules\better-sqlite3\build\src\util\macros.lzz(157): error C2039: 'AccessorSignature': is not a member of 'v8'
c:\users\...\.electron-gyp\20.0.3\include\node\v8.h(71): note: see declaration of 'v8'
c:\...\node_modules\better-sqlite3\build\src\util\macros.lzz(157): error C3083: 'AccessorSignature': the symbol to the left of a '::' must be a type
c:\...\node_modules\better-sqlite3\build\src\util\macros.lzz(157): error C2039: 'New': is not a member of 'v8'
c:\users\...\.electron-gyp\20.0.3\include\node\v8.h(71): note: see declaration of 'v8'
c:\...\node_modules\better-sqlite3\build\src\util\macros.lzz(157): error C3861: 'New': identifier not found
c:\...\node_modules\better-sqlite3\build\src\util\binder.lzz(37): error C2039: 'CreationContext': is not a member of 'v8::Object'
C:\Users\...\.electron-gyp\20.0.3\include\node\v8-value-serializer.h(21): message : see declaration of 'v8::Object'
On Windows (using the Visual Studio 2022 Build Tools):
C:\Users\...\.electron-gyp\20.0.3\include\node\v8-isolate.h(292,5): warning C4996: 'v8::LegacyOOMErrorCallback': Use OOMErrorCallback (https://crbug.com/1323177)
C:\Users\...\.electron-gyp\20.0.3\include\node\v8-isolate.h(1482,27): warning C4996: 'v8::LegacyOOMErrorCallback': Use OOMErrorCallback (https://crbug.com/1323177)
C:\Users\...\.electron-gyp\20.0.3\include\node\v8-isolate.h(1545,45): warning C4996: 'v8::WasmDynamicTieringEnabledCallback': Dynamic tiering is now enabled by default
C:\Users\...\.electron-gyp\20.0.3\include\node\v8-initialization.h(290,43): warning C4996: 'v8::LegacyOOMErrorCallback': Use OOMErrorCallback (https://crbug.com/1323177)
C:\...\node_modules\better-sqlite3\build\src\util\macros.lzz(157,21): error C2039: 'AccessorSignature': is not a member of 'v8'
C:\Users\...\.electron-gyp\20.0.3\include\node\v8.h(71): message : see declaration of 'v8'
C:\...\node_modules\better-sqlite3\build\src\util\macros.lzz(157,21): error C3083: 'AccessorSignature': the symbol to the left of a '::' must be a type
C:\...\node_modules\better-sqlite3\build\src\util\macros.lzz(157,40): error C2039: 'New': is not a member of 'v8'
C:\Users\...\.electron-gyp\20.0.3\include\node\v8.h(71): message : see declaration of 'v8'
C:\...\node_modules\better-sqlite3\build\src\util\macros.lzz(157,43): error C3861: 'New': identifier not found
C:\...\node_modules\better-sqlite3\build\src\util\binder.lzz(37,51): error C2039: 'CreationContext': is not a member of 'v8::Object'
C:\Users\...\.electron-gyp\20.0.3\include\node\v8-value-serializer.h(21): message : see declaration of 'v8::Object'
Related: #126 (comment)
Thanks for looking into it!
Reacted by Elschnagoo, Sadra Khosravi, alex-buys-github, Alan, John Weisz, jannikac, Stefan Erkenberg, Luca Olivieri, Nimar, Alexander Gabriel and 2 more
Activity
Prinzhorn commentedon Aug 25, 2022
#858
https://github.com/WiseLibs/better-sqlite3/search?q=CreationContext&type=issues
https://github.com/WiseLibs/better-sqlite3/search?q=AccessorSignature&type=issues
kryops commentedon Aug 25, 2022
😳 my bad, somehow I did not find the existing issue. Should we close this one then, or leave it open for better "Electron 20" visibility?
cshotton commentedon Sep 26, 2022
Is there a prognosis for when the next release might be that will include this pull request? It'd be great to get Electron builds working again.
122330602 commentedon Sep 27, 2022
two months passed, electron V20 is still not supported
cshotton commentedon Sep 28, 2022
FWIW you can npm install [email protected] and still get npx electron-rebuild -f -w better-sqlite3 to work as expected while we wait.
mckravchyk commentedon Oct 13, 2022
You don't have to wait:
npm install && npx electron-builder install-app-deps(you have to have electron-builder installed locally)cwellsx commentedon Oct 23, 2022
Thanks!
Though instead of doing a local install, i.e. of
file:, I found it better to install the released version of better-sqlite3 and then overwrite that in my project's node_modules i.e. by copying the PR on top of the released version.The local install didn't work so well with Webpack and Packaging.
Or there's now a comment in the pull thread saying,
linonetwo commentedon Jun 21, 2023
Solve electron25 build error nodejs/node#2341 (comment)