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.
Building node modules dependent on NAN stops working between the Electron versions
31.0.0-nightly.20240412and31.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:
I can see that
CopyablePersistantTraitsis 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#l00258Following the deprecation message
Use v8::Global insteadsolves the build issue but I know to little to know if that's the correct solution. An updated node version check before settingclass CopyablePersistentTraitsis also needed together with such an update.