danielcgilibert / blog-template

📚 Openblog is an elegant, simple, and user-friendly blog. Focused on accessibility, SEO and performance.
https://blog-template-gray.vercel.app
GNU General Public License v3.0
655 stars 234 forks source link

No Matching Function SetAccessor when pnpm installing better-sqlite3 #85

Closed theguruofreason closed 3 months ago

theguruofreason commented 3 months ago

When attempting pnpm i, better-sqlite3 fails to install with...

 |   ar crs Release/obj.target/deps/sqlite3.a @Release/obj.target/deps/sqlite3.a.ar-file-list
│   COPY Release/sqlite3.a
│   CXX(target) Release/obj.target/better_sqlite3/src/better_sqlite3.o
│ In file included from ./src/better_sqlite3.lzz:11,
│                  from ../src/better_sqlite3.cpp:4:
│ /home/iden/.cache/node-gyp/22.5.1/include/node/node.h:1252:7: warning: cast between incompatible function ty…
│  1252 |       (node::addon_context_register_func) (regfunc),                  \
│       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
│ /home/iden/.cache/node-gyp/22.5.1/include/node/node.h:1270:3: note: in expansion of macro ‘NODE_MODULE_CONTE…
│  1270 |   NODE_MODULE_CONTEXT_AWARE_X(modname, regfunc, NULL, 0)
│       |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
│ /home/iden/.cache/node-gyp/22.5.1/include/node/node.h:1301:3: note: in expansion of macro ‘NODE_MODULE_CONTE…
│  1301 |   NODE_MODULE_CONTEXT_AWARE(NODE_GYP_MODULE_NAME,                     \
│       |   ^~~~~~~~~~~~~~~~~~~~~~~~~
│ ./src/better_sqlite3.lzz:67:1: note: in expansion of macro ‘NODE_MODULE_INIT’
│ ./src/util/macros.lzz: In function ‘void SetPrototypeGetter(v8::Isolate*, v8::Local<v8::External>, v8::Local…
│ ./src/util/macros.lzz:150:46: error: no matching function for call to ‘v8::ObjectTemplate::SetAccessor(v8::L…
│ In file included from /home/iden/.cache/node-gyp/22.5.1/include/node/v8-function.h:15,
│                  from /home/iden/.cache/node-gyp/22.5.1/include/node/v8.h:33,
│                  from /home/iden/.cache/node-gyp/22.5.1/include/node/node.h:73,
│                  from ./src/better_sqlite3.lzz:11,
│                  from ../src/better_sqlite3.cpp:4:

Node -v: v22.5.1 pnpm -v: 9.6.0 OS: Ubuntu 22.04.4 kernel: 6.5.0-45-generic

ncouturier commented 3 months ago

+1

myzk995 commented 3 months ago

I changed the version of better-sqlite3 in pnpm-lock.yml and pnpm i succeeded

8213  /better-sqlite3@8.7.0:
8214    resolution: {integrity: sha512-99jZU4le+f3G6aIl6PmmV0cxUIWqKieHxsiF7G34CVFiE+/UabpYqkU0NJIkY/96mQKikHeBjtR27vFfs5JpEw==}
...
14875  /sqlite-level@1.0.1:
14876    resolution: {integrity: sha512-uPo21L96VADz/PPkkZoPNMH9fURTQLDrSVe8XJUwPjqvTi3xigDvCfoektZdvoEgRAiaHchOgksW7YBoyVyEnw==}
14877    dependencies:
14878      abstract-level: 1.0.3
14879      better-sqlite3: 8.7.0

8213  /better-sqlite3@11.1.2:
8214    resolution: {integrity: sha512-gujtFwavWU4MSPT+h9B+4pkvZdyOUkH54zgLdIrMmmmd4ZqiBIrRNBzNzYVFO417xo882uP5HBu4GjOfaSrIQw==}
...
14875  /sqlite-level@1.0.1:
14876    resolution: {integrity: sha512-uPo21L96VADz/PPkkZoPNMH9fURTQLDrSVe8XJUwPjqvTi3xigDvCfoektZdvoEgRAiaHchOgksW7YBoyVyEnw==}
14877    dependencies:
14878      abstract-level: 1.0.3
14879      better-sqlite3: 11.1.2
theguruofreason commented 3 months ago

Yes, I solved this by deleting the outdated pnpm-lock.yaml and running pnpm i as well. The repo should be updated with a fresh lock, or better yet just gitignore the lock.