-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Support node-canvas
#5835
Comments
Related to #3110 Original issue: Hello! I've installed canvas on my project and seem to be getting errors whenever I use it. I created a repository with the bare code required to create the error. Code: import * as canvas from "canvas";
(async () => {
canvas.loadImage("https://static.bunnycdn.ru/i/cache/images/3/37/375e7fdc580766874948e5bf678e2a8a.jpg").then((image) => {
console.log("Loaded!");
const c = canvas.createCanvas(image.width, image.height);
const context = c.getContext('2d');
context.drawImage(image, 0, 0);
})
}); Error:
Repository: https://github.com/Eltik/Bun-canvas Originally reported on Discord: |
Having the same issue in my Nuxt application, when I try to deserialise my imageDataUrl on the API server |
I have been playing around with Bun since about 1.0.2 and node-canvas is a package I use extensively for generating server side charts through Chart.js. For modules that do not require canvas, Bun is great and I love being able to run Typescript modules directly without transpiling. But most of the projects are Chart.js based. I understand there are two issues with node-canvas support but the one I run into is the lack of support for the node_module_register API entry point. The other issues reported is related to the npm registry and a background update. |
Any update on this? facing the same error
|
Are there any working alternatives in the mean time? |
Facing same issue on Bun using |
+1 here. support for |
FWIW there is canvaskit-wasm. |
some of our modules (including jsdom) try to link |
@chriskrogh Would assigning the canvas api from canvis-kit onto |
I'm not sure when I would do that? this issue arises early on in the installation process and aborts |
When are we gonna have this? |
I think I'm hitting the same thing, I have a project that works with
Is this the correct issue to report this / follow, or should I file a separate issue ? Thanks. |
is this likely to be resolved soon? |
and this error? root@celestrox:~/celestrox/backend# bun run ./src/server.ts |
I got the same error trying to move to Bun. I have several projects with C Bidings libs, It would be awesome to have this support. |
Bun recode of my API currently halted because of this issue :( |
For anyone looking for an alternative, I was able to use @napi-rs/canvas. It was basically a drag and drop replacement other than a few lines. |
Thank you, @ignSKRRRTT! Got a puzzle game image generator that I could not continue work on until this was figured out. |
This is blocked on #4290 or Automattic/node-canvas#2235 (node-canvas 3.0), whichever happens first As of node-canvas v2.11.2, here are the list of symbols we would need to implement in order to support this version:
|
It is gonna take a year to implement all these |
Hi @robobun the module that you mean is canvas, not node-canvas, so it's not |
Thanks! It helps. |
To use node-canvas in Bun, upgrade to node-canvas's v3:
node-canvas@latest
does not currently work with Bun as it relies on some v8-specific APIs in NodeWe may eventually implement these: #3110
Or perhaps it would be easier to upstream a fix
This also blocks
jsdom
The text was updated successfully, but these errors were encountered: