Repository navigation
Description
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a bug report that matches the one I want to file, without success.
Electron Version
44.0.0
What operating system(s) are you using?
Ubuntu
Operating System Version
22.04
What arch are you using?
x64
Last Known Working Electron version
41
Does the issue also appear in Chromium / Google Chrome?
I don't know how to test
Expected Behavior
When compiling a native C++ addon, it should succeed.
Actual Behavior
The compilation breaks because of incorrect Electron headers?
Testcase Gist URL
No response
Additional Information
NodeJS v24.18.1 v8-primitive.h:
https://github.com/nodejs/node/blob/9623d9ad85d37d2f0610ec4a82b48182cf2c6061/deps/v8/include/v8-primitive.h#L676-L681
class V8_EXPORT Value {
public:
V8_DEPRECATE_SOON(
"Prefer using String::ValueView if you can, or string->Write to a "
"buffer if you cannot.")
Value(Isolate* isolate, Local<v8::Value> obj);
By comparison, when downloaded from https://www.electronjs.org/headers/v44.0.0/node-v44.0.0-headers.tar.gz
(node-gyp --verbose configure --target=44.0.0 --arch=x64 --dist-url=https://electronjs.org/headers)
class V8_DEPRECATED(
"Prefer using String::ValueView if you can, or string->Write to a "
"buffer if you cannot.") V8_EXPORT Value {
public:
V8_DEPRECATED(
"Prefer using String::ValueView if you can, or string->Write to a "
"buffer if you cannot.")
Value(Isolate* isolate, Local<v8::Value> obj);
...note the duplicate macro V8_DEPRECATED causing error:
/home/runner/.cache/node-gyp/44.0.0/include/node/v8config.h:865:20: error: expected identifier before ‘__attribute__’
865 | # define V8_EXPORT __attribute__((visibility("default")))
| ^~~~~~~~~~~~~
/home/runner/.cache/node-gyp/44.0.0/include/node/v8-primitive.h:657:32: note: in expansion of macro ‘V8_EXPORT’
657 | "buffer if you cannot.") V8_EXPORT Value {
| ^~~~~~~~~
In file included from /home/runner/.cache/node-gyp/44.0.0/include/node/v8-object.h:14,
from /home/runner/.cache/node-gyp/44.0.0/include/node/v8-array-buffer.h:14,
from /home/runner/.cache/node-gyp/44.0.0/include/node/v8.h:24,
from /home/runner/.cache/node-gyp/44.0.0/include/node/node.h:80,
from ../node_modules/nan/nan.h:67,
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fields👍 Does Not Block Stable
Activity
danielweck commentedon Aug 28, 2026
I am closing this for now, as the source of the error is likely at my end (I have a hard time believing that the
V8_DEPRECATEDorV8_DEPRECATE_SOONmacro situated before theV8_EXPORTmacro would cause C++ compiler issues).Here is the diff from 41 to 44:
41:42:43:44:danielweck commentedon Aug 28, 2026
Note that in NodeJS
26.8.1,class V8_EXPORT Valueis neitherV8_DEPRECATE_SOONorV8_DEPRECATED, so I wonder why the Electron headers for Electron42,43and44(NodeJS24) applies the deprecation on the class? (also, isn't the macro located in the wrong slot?)https://github.com/nodejs/node/blob/7be6d3af31a65adea57c94c41e50c2b071ed0b3a/deps/v8/include/v8-primitive.h#L622-L627
danielweck commentedon Aug 28, 2026
Alright, I worked-around this problem by disabling the
V8_DEPRECATEDin mybinding.gyp:'defines!': ['V8_DEPRECATION_WARNINGS=1']For reference:
https://github.com/nodejs/node/blob/9623d9ad85d37d2f0610ec4a82b48182cf2c6061/deps/v8/include/v8config.h#L607-L611
So, am I right in assuming that the class/macro order is incorrect? See:
class V8_DEPRECATED("...") V8_EXPORT Valuevs.
V8_DEPRECATED("...") class V8_EXPORT ValueIf so, I am amazed nobody reported this problem since it exists in
42,43, and now44.If not, what could possibly cause the breakage at my end??
[-]Broken Electron 44.0.0 headers `v8-primitive.h`[/-][+]Broken Electron header `v8-primitive.h` due to class/macro order in `42`, `43`, `44` (`41` didn't have the misplaced macro)[/+]nmggithub commentedon Aug 28, 2026
Hello! Taking a look at this, and this appears to maybe be a compiler compatibility issue. Can you try compiling with GCC 13+ or Clang?
danielweck commentedon Aug 28, 2026
Thank you for taking the time to reply, much appreciated.
I need to check the build logs to be sure, but I was testing on the default SBOM for the Ubuntu 22.04 GitHub Actions runner.
nmggithub commentedon Aug 28, 2026
From what I can find, Ubuntu 22.04 uses GCC 11 by default.
8 remaining items
test: build C++ API addon fixtures with the Chromium toolchain on Linux
test: build C++ API addon fixtures with the Chromium toolchain on Linux
test: build C++ API addon fixtures with the Chromium toolchain on Linux
test: build C++ API addon fixtures with the Chromium toolchain on Linux
test: cope with hosts that cannot build the Electron-header addon fix…
test: cope with hosts that cannot build the Electron-header addon fix…
test: cope with hosts that cannot build the Electron-header addon fix…
test: cope with hosts that cannot build the Electron-header addon fix…
test: cope with hosts that cannot build the Electron-header addon fix…
fix: backport Node.js cleanup hook fixes for node::ObjectWrap addons (#…
fix: backport Node.js cleanup hook fixes for node::ObjectWrap addons …
fix: backport Node.js cleanup hook fixes for node::ObjectWrap addons …
fix: backport Node.js cleanup hook fixes for node::ObjectWrap addons …
fix: backport Node.js cleanup hook fixes for node::ObjectWrap addons …