geelen / react-snapshot

A zero-configuration static pre-renderer for React apps
MIT License
1.66k stars 104 forks source link

Error when building when <canvas /> is being used #123

Open ca-miked opened 5 years ago

ca-miked commented 5 years ago

Hi,

I'm getting a canvas element error message when trying to build a project that is using a <canvas /> tag. Per the error message, I installed the canvas npm package but this did not resolve the error.

Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package)

Any ideas/suggestions on a fix or workaround?

Thanks

ca-miked commented 5 years ago

Here's the more detailed stack trace

🕷 Starting crawling http://localhost:52417/ Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package) at module.exports (/Users/.../create-react-app-router/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17) at HTMLCanvasElementImpl.getContext (/Users/.../create-react-app-router/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js:42:5) at HTMLCanvasElement.getContext (/Users/.../create-react-app-router/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js:30:56)

ca-miked commented 5 years ago

Bump...

Pardeep94 commented 4 years ago

@ca-miked I am facing same issue, do you find any solution for same ?

hamzox commented 4 years ago

Facing the same issue, any luck here? :'(

Mickaz89 commented 3 years ago

same issue

aayush27 commented 2 years ago

Same issue