Skip to content
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

NPM installation fails with a v8-related compile error on Node v22.2 w/ GCC 14.1.1 #363

Open
paulie-g opened this issue Jun 12, 2024 · 1 comment

Comments

@paulie-g
Copy link

OS: Arch Linux latest
Node: v22.2.0
GCC: 14.1.1

There were some other errors I was able to work around with CXX_FLAGS='-fpermissive', but this one stops the show:

635 error ../src/gobject.cc: In function ‘v8::MaybeLocal<v8::FunctionTemplate> GNodeJS::NewClassTemplate(GType)’:                                                                                                                                                                                                                                                                         
635 error ../src/gobject.cc:554:43: error: no matching function for call to ‘v8::NamedPropertyHandlerConfiguration::NamedPropertyHandlerConfiguration()’                                                                                                                                                                                                                                  
635 error   554 |     v8::NamedPropertyHandlerConfiguration config;                               
@haxibami
Copy link

This patch worked for me (I'm a C++ newbie, so I'm not sure if this is the correct code)

diff --git a/package-lock.json b/package-lock.json
index 58a98eb..f64501d 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -14,7 +14,7 @@
         "lodash.camelcase": "4.3.0",
         "lodash.isequal": "4.5.0",
         "lodash.snakecase": "^4.1.1",
-        "nan": "^2.17.0",
+        "nan": "^2.21.0",
         "node-gyp": "^9.3.1",
         "remove-trailing-spaces": "^1.0.7",
         "unindent": "^2.0.0"
@@ -1847,9 +1847,10 @@
       "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
     },
     "node_modules/nan": {
-      "version": "2.18.0",
-      "resolved": "https://registry.npmjs.org/nan/-/nan-2.18.0.tgz",
-      "integrity": "sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w=="
+      "version": "2.21.0",
+      "resolved": "https://registry.npmjs.org/nan/-/nan-2.21.0.tgz",
+      "integrity": "sha512-MCpOGmdWvAOMi4RWnpxS5G24l7dVMtdSHtV87I3ltjaLdFOTO74HVJ+DfYiAXjxGKsYR/UCmm1rBwhMN7KqS1A==",
+      "license": "MIT"
     },
     "node_modules/negotiator": {
       "version": "0.6.3",
diff --git a/package.json b/package.json
index ba108ba..05444f7 100644
--- a/package.json
+++ b/package.json
@@ -36,7 +36,7 @@
     "lodash.camelcase": "4.3.0",
     "lodash.isequal": "4.5.0",
     "lodash.snakecase": "^4.1.1",
-    "nan": "^2.17.0",
+    "nan": "^2.21.0",
     "node-gyp": "^9.3.1",
     "remove-trailing-spaces": "^1.0.7",
     "unindent": "^2.0.0"
diff --git a/src/gobject.cc b/src/gobject.cc
index 78c5035..4cfd23f 100644
--- a/src/gobject.cc
+++ b/src/gobject.cc
@@ -551,8 +551,7 @@ static MaybeLocal<FunctionTemplate> NewClassTemplate (GType gtype) {
     // Set the fallback accessor to allow non-introspected property.
     // Nan::SetNamedPropertyHandler() does not support flags. Thus, using
     // V8 interface directly.
-    v8::NamedPropertyHandlerConfiguration config;
-    config.getter = GObjectFallbackPropertyGetter;
+    v8::NamedPropertyHandlerConfiguration config(GObjectFallbackPropertyGetter);
     config.setter = GObjectFallbackPropertySetter;
     config.flags = static_cast<v8::PropertyHandlerFlags>(
         static_cast<int>(v8::PropertyHandlerFlags::kNonMasking) |

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants