Skip to content

Incompatible with recent Electron (v35+) due to deprecated V8 API usage #42

@LukasWestholt

Description

@LukasWestholt

Hi,

I'm trying to use node-libgpiod in an [Electron](https://www.electronjs.org/) project (specifically the [MagicMirror²](https://github.com/MagicMirrorOrg/MagicMirror) platform). However, the rebuild using electron-rebuild fails due to incompatibilities with the latest Electron versions (v35+), which are built against a newer V8 engine.

Here's the relevant error from the build log:

error: no matching function for call to ‘v8::ScriptOrigin::ScriptOrigin(v8::Isolate*, v8::Local<v8::Value>&)’

This seems to stem from how Nan::ScriptOrigin is used in nan_scriptorigin.h. Electron v35 uses a version of V8 where some ScriptOrigin constructors have changed, and calls like:

v8::ScriptOrigin(v8::Isolate::GetCurrent(), name)

are no longer valid.

This results in node-gyp failing to build the module when called via electron-rebuild.


Steps to reproduce:

  1. Use latest Electron (e.g., v35.1.2).
  2. Add node-libgpiod as a dependency.
  3. Run npx electron-rebuild.
  4. Observe the build failure.

Environment:

  • Electron: 35.1.2
  • Node.js: Electron bundled version
  • OS: Debian 12 (Raspberry Pi)

Possible Solution:

Updating the native code to use the new v8::ScriptOrigin constructor with all required parameters (e.g., resource_name, line_offset, column_offset, etc.). Alternatively, conditionally compile based on V8 version or use N-API if feasible.

Let me know if I can help test a patch or provide more build logs.

Thanks for your work on this module!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggpiod-1.xall related to underlying libgpiod-1.x series

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions