Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'GetContents' in 'v8::ArrayBuffer'

I'm using Mac M1 and I've just upgraded to Node 14.17.6LTS.

I tried to rebuild better_sqlite3 (7.4.3) using with electron builder (22.11.7) and I'm getting the following errors:

no member named 'GetContents' in 'v8::ArrayBuffer'

Any ideas how to solve this? Thanks in advance!

gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  SOLINK_MODULE(target) Release/.node
  CXX(target) Release/obj.target/fse/fsevents.o
In file included from ../fsevents.cc:6:
In file included from ../../nan/nan.h:2884:
../../nan/nan_typedarray_contents.h:34:43: error: no member named 'GetContents' in 'v8::ArrayBuffer'
      data   = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
like image 262
gsy Avatar asked Oct 14 '22 19:10

gsy


1 Answers

I'm using Mac M1 and I've just upgraded to Node 14.17.6LTS.

An interesting choice, given that Node 16 officially introduced M1 support.

no member named 'GetContents' in 'v8::ArrayBuffer'

See this doc. In short, GetContents was replaced by GetBackingStore in late 2019. Being a compatibility layer, nan adapted to this in early 2020.

So you'll probably have to ensure that the versions of all involved packages (Node, nan, electron, ...) match each other (in the sense of having been released around the same time and targeting each other).

like image 58
jmrk Avatar answered Oct 18 '22 14:10

jmrk