Skip to content

Latest commit

 

History

History
19 lines (11 loc) · 1.13 KB

sharp-missing-in-production.md

File metadata and controls

19 lines (11 loc) · 1.13 KB

Sharp Missing In Production

Why This Error Occurred

The next/image component's default loader uses squoosh because it is quick to install and suitable for a development environment. For a production environment using next start, it is strongly recommended you install sharp by running yarn add sharp in your project directory.

You are seeing this error because Image Optimization in production mode (next start) was detected.

Possible Ways to Fix It

  • Install sharp by running yarn add sharp in your project directory and then reboot the server by running next start again
  • If sharp is already installed but can't be resolved, set the NEXT_SHARP_PATH environment variable such as NEXT_SHARP_PATH=/tmp/node_modules/sharp next start

Note: This is not necessary for Vercel deployments, since sharp is installed automatically for you.

Useful Links