-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Electron-rebuild canvas 2.6.1 fails on Windows 10: Canvas.obj : error LNK2001: unresolved external symbol #1589
Comments
Seems this has something to do with: nodejs/node#30339: src: migrate to newer V8 ArrayBuffer APIs ?
Don't really understand enough of the Electron build process to figure out why the build fails with the Electron v8 using electron-rebuild. Tested with newest Electron 9 also, which should include v8 8.3, which should have this change already made in it. Downgraded my Node from 14.x to the LTS release 12.16.3 but no success either there. |
I had the same problem with version 2.14.1 of nan. After switching back to 2.14.0 everything works. |
Thank you @Thosty , this indeed fixed the compilation problem! Will report the bug to the nan repository. |
Will close this issue as not directly a node-canvas issue, installing nan v2.14.0 manually fixed the problem. |
I installed "nan": "2.13.2" in node_modules/canvas with below command And, This is working Node: 14.16.0 |
@nkhs @Sakari369 not working for me Win10 By the way, my mac is fine. |
@wxfred Yeah no idea about Windows. Seems with these problems the solution is to try install and re-install different versions. |
Faced this issue again when rebuilding node-canvas for Windows 10. @wxfred installing [email protected] manually fixed this for me, as mentioned before by Thosty. |
@Sakari369 Thanks a lot, I made it with win10 But, |
I have the same problem. Is there any "official" solution coming? The versions @wxfred provided don't work for me... |
I have the same problem with newest versions... Is there a fix for that? |
I have same problem as well. Have been troubleshooting for weeks and cannot find a workaround / solution. This is very frustrating because node-canvas is a dependency in many packages so it not only effects node-canvas but most packages that utilize. Has anyone figured out a decent workaround? I am fine if it is super hacky for the time being. Thanks! |
Hey @GitMurf , did you find any solution for this ? Seems this failure happens again with Electron 24 and newest or older version of canvas on Windows 10. Fixing nan package to 2.14.0 no longer works it seems. Might have to spend some time looking into this. |
@Sakari369 good news! The solution was essentially that canvas needed to migrate to using node addon api instead of nan. Here are details: #923 And lucky for you with this timing, @chearon just submitted a PR for this (months ... really years, in the making!) #2235 |
Good news! Thanks for sharing 🙂 I was mentally prepared to spend couple of days to find a quick fix for this somehow, but happy that this issue might be fixed for good with the migration to n-api. Have you tested the branch with the pr ? |
I have not tested it yet. Priorities have shifted for my application so it isn't as urgent anymore so I will test when it gets officially released.
I thought that as well and after weeks of attempts I realized there really wasn't a "quick fix" so good thing you avoided that rabbit hole ;-) |
Thanks for the info! Yeah.. okay good to know that :) |
@GitMurf I am developing an Electron app that relies on |
Thanks for confirming it works even "as is" before it gets merged. Great news! I'll probably get around to testing it next week. |
i have the same problem but in my case i am having this problem because of a library i am using |
The issue still persists. Tried doing |
I am having the same problem while including the latest version of Automattic/node-canvas. Has there been any new updates or ways to resolve this issue in the past several months? |
Unfortunately I don't think so. @chearon do you know what current status is? Thanks! |
Issue or Feature
Build fails in Windows 10 x64 using electron-rebuild with Electron.
Build works perfectly fine with just npm install canvas or building manually with node-gyp configure && node-gyp build.
Seems to be something incompatible with the canvas and the electron environment ?
Building the canvas works perfectly fine with same setup in macOS Mojave.
The specific error reported by the compiler:
Steps to Reproduce
Install all the windows build prerequisities (GTK, libjpeg) in the locations provided by the install instructions.
Running
Fails with the following message errors:
This line being the culprit:
Canvas.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::shared_ptr __cdecl v8::ArrayBuffer::GetBackingStore(void)" (_imp?GetBackingStore@ArrayBuffer@v8@@qeaa?AV?$shared_ptr@VBackingStore@v8@@@std@@xz)
Your Environment
npm list canvas
oryarn list canvas
):Electron 8.2.0, electron-rebuild 1.11.0 on Windows 10 x64.
MSVC2019 Community edition
Any help is appreciated!
Anybody got the canvas module rebuilt in Windows using electron-rebuild ?
Thank you.
The text was updated successfully, but these errors were encountered: