building with turbopack breaks the app if you're using sharp as a dependency #83230
Replies: 4 comments 11 replies
-
Interesting, are you using If you are using |
Beta Was this translation helpful? Give feedback.
-
this is definitly a bug with turbopack and need to be adressed before it goes live |
Beta Was this translation helpful? Give feedback.
-
In my case the build process succeeds without errors. The build machine does not have any problems with turbopack. The production server throws 500s when trying to load something that requires sharp with the above mentioned error "Failed to load external module...". |
Beta Was this translation helpful? Give feedback.
-
What's the minimal set of changes I need to do to a create-next-app to cause this error? Just install sharp explicitly? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
this started happening after i added the --turbopack flag to next build:
⨯ Error: Failed to load external module sharp: Error: Could not load the "sharp" module using the linux-x64 runtime
Possible solutions:
npm install --include=optional sharp
See https://sharp.pixelplumbing.com/install#cross-platform
npm install --os=linux --cpu=x64 sharp
removing the flag makes the problem go away
Beta Was this translation helpful? Give feedback.
All reactions