Skip to content

Build fails on Electron 42+/V8 13 (nan + C++20) #11

Description

@risleylima

Problem

Rebuilding @grandchef/node-printer@0.8.0 against Electron 42+ (tested with Electron 43.3.0, darwin arm64) fails.

1. Outdated nan vs V8 13 APIs

Compilation fails inside nan headers with errors such as:

  • v8::External::Value / New now require ExternalPointerTypeTag
  • GetAlignedPointerFromInternalField / SetAlignedPointerInInternalField signature changes
  • v8::AccessControl removed in newer V8

These are covered by nan@2.28.0 (nodejs/nan#1015, changelog 2.28.0).

Current dependency: "nan": "^2.19.0" often resolves below 2.28.0.

2. C++17 is no longer enough

Even after fixing nan, Electron/Node headers emit:

#error "C++20 or later required."

binding.gyp still sets -std=c++17 / -std:c++17 for macOS / Linux / Windows.

Environment

  • Electron 43.3.0
  • macOS darwin arm64
  • Rebuild via @electron/rebuild / electron-builder install-app-deps

Proposed fix

  1. Pin/bump nan to 2.28.0
  2. Raise binding.gyp language standard to C++20 on win/mac/linux

I can open a PR with that patch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions