-
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
Rebuilding node-canvas with electron-rebuild fails #2200
Comments
If it is in [email protected] The following error occurs when building。 Same issue: 2165 |
@linqian02 I have the same issue. Perhaps @napi-rs/canvas could be used instead of node-canvas.
|
Thank you for your reply!I will try to see if it is feasible |
Most of the problems around Canvas in Electron (as I understand it) is that the canvas [node-cavas] module is not context aware. ref: #1394 |
Switching to the N-API version would satisfy using Canvas in Electron programs |
@ajoslin103 Is it not possible to use node-canvas in Electron? |
I also found that headless-gl could not be electron@21 Rebuild succeeded. It also uses nan instead of n-api. Whether it is the nodejs native module developed by nan that is no longer supported by electron? |
@linqian02 you can follow the comments on this pr #1981 to see the progress this module is making towards being context-aware and this discussion at electronjs to read more about the issue electron/electron#18397 |
Thank you. I'll try again to see if it's feasible |
@linqian02 fyi for a full history on this see the following GH issues that I have opened across Electron, Node, pdf.js and node-canvas repos (as they all have a part in my issues which sound similar to yours). The TLDR is that until node-canvas decides to migrate from NaN to the napi/N-API/node-addon-api (they use a lot of different names haha) then node-canvas will not work with Electron (and for me unfortunately since pdf.js has node-canvas as a dependency, I am not able to use pdf.js either). In 2017 the Node Addon API team actually made a port of node-canvas, but it has sense become VERY outdated and does not work. See here: #923 Here are the relevant issues that I found / accumulated over my several weeks of research: electron/rebuild#1042 |
I have found that the FabricJS canvas library (browser-pure, I think) works just fine with electron !! I've been using canvas w/Fabric with my Electron project with no issues I found out when I saw this project that uses Fabric just as a Canvas (I think) https://blog.logrocket.com/build-indoor-maps-fabric-js-react/ (I was unable to figure out how it was making any Fabric calls) |
Thanks for this, I've tested it, and it is correct. |
Rebuilding node-canvas with electron-rebuild fails
The text was updated successfully, but these errors were encountered: