Closed version-1 closed 5 years ago
It looks like the canvas package wasn't installed along with jsdom. My first thought is to try reinstalling your dependencies. Can you link to a repo that reproduces the issue?
Same problem can easily replicate just by installing and dropping in default configuration
It looks like jsdom needs the canvas package. Can either of you try running npm install canvas
and try a build again? If that fixes it I’ll add it as a dependency for now until I have time to come up with a better solution.
@jafaircl i tried this and unfortunately it did not resolve the issue
@jafaircl @jpreecedev
Can you link to a repo that reproduces the issue?
I can't prepare it repository soon but I think the error occur on development env.
gatsby develop
It may be caused the sources are built on web
not node
.
https://webpack.js.org/concepts/targets/
It seems like jsdom is work on only 'node' .
I’ll take a look at it tomorrow and get a better idea of what’s happening and how it can be fixed.
Now that I’m looking into it, could you try running npm install canvas-prebuilt
? It seems like jsdom is fine with that package and I’m seeing issues in the jsdom repo where that seems to fix similar problems.
@jafaircl I can confirm that installing canvas-prebuilt
doesn't resolve the issue. Anything I can do to help?
Ok after taking a look at it and pushing a new version, 0.1.26 should fix this issue. Please let me know if it doesn’t. Thanks for all your help.
@jpreecedev pull requests are always welcome
This appears to have been resolved
Great. I'll close it for now and if this pops up again I'll reopen it.
I installed this and build on with develop but it failed. How do I fix this?