Next.js Discord

Discord Forum

Sharp is missing in production build

Unanswered
Silver carp posted this in #help-forum
Open in Discord
Silver carpOP
I am using mono repo and I've install sharp in my next package, but when I run the production build, it will show 'sharp' is required to be installed in standalone mode for the image optimization to function correctly

In the doc, it says you may need to specify the sharp path
I am using yarn v3(yarn pnp), so I've tried NEXT_SHARP_PATH=./.yarn/cache/sharp-npm-0.33.4-afc15185a7-f5f91ce2a6.zip yarn build. It still doesn't work.

I am using
sharp@0.33.4
next@14.2.3

Is there anyone know how to solve this problem? much appreciated.

4 Replies

Transvaal lion
I have the same problem but haven't found a solution yet.
If you're planning to host the app on Vercel you won't need it.
Silver carpOP
Unfortunately, we host it on kubernates not Vercel.
The warning is quite noisy in the log tracking 😢
If I found any viable solution. I'll share it in the post
Silver carpOP
bump