Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node-gyp build on windows for electron 12/13 fails #1868

Open
derpoho opened this issue Jul 26, 2021 · 10 comments
Open

node-gyp build on windows for electron 12/13 fails #1868

derpoho opened this issue Jul 26, 2021 · 10 comments

Comments

@derpoho
Copy link

derpoho commented Jul 26, 2021

Issue

When trying to build the native module for windows & ele3ctron 13.0.0 the node-gyp command fails with missing external symbol error.

Steps to Reproduce

npm install canvas
cd ./node_ modules/canvas
node-gyp rebuild --target=13.0.0 --dist-url=https://electronjs.org/headers

Error:

Canvas.obj : error LNK2001: unresolved external symbol
 ""__declspec(dllimport) public: class std::shared_ptr<class 
v8::BackingStore> __cdecl v8::ArrayBuffer::GetBackingStore(vo 
id)" (__imp_?GetBackingStore@ArrayBuffer@v8@@QEAA?AV?$shared_ 
ptr@VBackingStore@v8@@@std@@XZ)".

Your Environment

  • Version of node-canvas: 2.6.1 / 2.8.0
  • Environment: node 14.17.0 / 15.14.3 on windows 10
@derpoho derpoho changed the title npde-gyp build on windows for electron 12/13 fails node-gyp build on windows for electron 12/13 fails Jul 26, 2021
@victorquanlam
Copy link

I have the same issue on windows :(

@goldyteam
Copy link

goldyteam commented Nov 8, 2021

You have to go to \node_modules\nan\nan_typedarray_contents.h and change the condition around line 36 to only have

data = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;

@KiPSOFT
Copy link

KiPSOFT commented Nov 24, 2021

You have to go to \node_modules\nan\nan_typedarray_contents.h and change the condition around line 36 to only have

data = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;

I'm getting this error; v8 array buffer not have GetContents function. How's solve this issue ?

@Ph0non
Copy link

Ph0non commented Nov 25, 2021

This seems to be relevant to #nodejs/nan#922

Suggestion from there:

Stop using nan and switch to node-addon-api

@Jun90925
Copy link

Same issue here.
Any progress ?

@JSoon
Copy link

JSoon commented Dec 20, 2021

This seems to be relevant to #nodejs/nan#922

Suggestion from there:

Stop using nan and switch to node-addon-api

This needs to migrate from nan to node-addon-api, which is currently not implemented by node-canvas. @zbjornson Any plan for this #892?

As the Electron upgrades, rebuilding canvas after 13.x just won't work on Windows 😢.

@semireg
Copy link

semireg commented Feb 15, 2022

Has there been any progress on this? I'm happy to test... trying to update my electron app deps and this is a blocker.

@flynnhou
Copy link

flynnhou commented Mar 9, 2022

Same here... Gotten blocked by the rebuild issues on Windows for a while. Any workaround will be great too...

@EvanBldy
Copy link

I have the same problem, did someone found a solution to fix this?

@GitMurf
Copy link

GitMurf commented Nov 11, 2022

This seems to be relevant to #nodejs/nan#922
Suggestion from there:

Stop using nan and switch to node-addon-api

This needs to migrate from nan to node-addon-api, which is currently not implemented by node-canvas. @zbjornson Any plan for this #892?

As the Electron upgrades, rebuilding canvas after 13.x just won't work on Windows 😢.

Did you ever find a solution here? I am dealing with this problem with my Electron app trying to use pdf.js library which relies on node-canvas. Very frustrating!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests