Skip to content

Error when building NAN modules targeting Electron 31.0.0-beta.8 ('CopyablePersistentTraits': is not a member of 'v8') #969

Description

@andreasdj

Building node modules dependent on NAN stops working between the Electron versions 31.0.0-nightly.20240412 and 31.0.0-alpha.1. Between those versions chromium/v8 has been updated to from 124/12.4 to 125/12.5 and node from v20.11.1 to v20.12.2.

The following error is reported:

node_modules\nan\nan.h(211,47): error C2039: 'CopyablePersistentTraits': is not a member of 'v8'

I can see that CopyablePersistantTraits is marked as deprecated in the v8 source code for node 20, is that the reason? https://v8docs.nodesource.com/node-20.3/da/d1f/v8-persistent-handle_8h_source.html#l00258

Following the deprecation message Use v8::Global instead solves the build issue but I know to little to know if that's the correct solution. An updated node version check before setting class CopyablePersistentTraits is also needed together with such an update.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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