-
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
'TypeError: Image or Canvas expected' when importing node-canvas in different modules #487
Comments
This is killing me |
Hi, Can you tell me how to fixed this bug? thx |
I can't find the other issue that discusses this more, but there is no way to fix this in node-canvas itself because it's a limitation of native addons (two different builds of node-canvas don't produce compatible objects). At some level, your JS code needs to make sure that it's using the same |
Tanks for your anwser. |
yeah, experienced this gotta make the canvas package same across all modules that using |
Maybe should the dependencies use |
As previously reported at #338 (comment), when someone tries to use
canvas
on two different modules, it breaks.For example, if in one module we have:
And in the other:
That breaks because we are trying to draw an
Image
created using a different requiredcanvas
than that one we are using to draw the image. The following error is reported:A possible fix is to both modules require the same
node-canvas
. However, this is just a temporary fix.The text was updated successfully, but these errors were encountered: