1

I upgraded from nextJs from 10.0.5 to 10.0.6 and the build is now failing with the following message: Error: Module did not self-register: '.../node_modules/canvas/build/Release/canvas.node.

I am not importing canvas directly, but it's used by fabricjs. I am having hard time to understand what's going on here with this Module did not self-register error message.

I just figured out that Vercel has been making some changes in the webpack config according to the release notes, so this would be the starting point to investigate, which I did with no success so far.

Side note: the build is still breaking with latest (to date) version 10.0.7 of NextJS. This is unfortunate since it's preventing me to upgrade beyond 10.0.5

Edit

After some investigation, I identified that the issue is occurring when I am using getStaticPaths to generate static files based on dynamic routes. My hypothesis is that nextjs 10.0.6+ is using worker threads in its build process to generate static files based on dynamic routes.

Since worker threads are not supported by canvas (as per this issue) this could explain why the build is failing.

Eturcim
  • 798
  • 8
  • 26

0 Answers0