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

canvas2image npm not working #24

Open
keshav1007 opened this issue Nov 15, 2017 · 2 comments
Open

canvas2image npm not working #24

keshav1007 opened this issue Nov 15, 2017 · 2 comments

Comments

@keshav1007
Copy link

After installing canvas2image npm. I am getting the following error:

TypeError: Canvas2Image.saveAsPNG is not a function

@mapkab
Copy link

mapkab commented Nov 21, 2017

the reason why using npm doesn't work is that the node_module 'canvas2image' only contains the 'var Canvas2image=function(){...' . you could replace 'module.exports=function(){...' instead of ''var Canvas2image=function(){...' in the node_module js file 'canvas2image.js', then using 'require()' does work.

@JonathanTreffler
Copy link

JonathanTreffler commented Aug 2, 2020

I created a fork, that uses ES6 modules so you can import it: https://github.com/TessyPowder/canvas2image-2

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

3 participants