Sharp Version Does Not Support AVIF
Why This Error Occurred​
The next/image component's default loader uses sharp if its installed.
You are seeing this error because you have an outdated version of sharp installed that does not support the AVIF image format.
AVIF support was added to sharp in version 0.27.0 (December 2020) so your installed version is likely older.
Possible Ways to Fix It​
- Install the latest version of
sharpby runningnpm i sharp@latestin your project directory - If you're using the
NEXT_SHARP_PATHenvironment variable, then update thesharpinstall referenced in that path, for examplecd "$NEXT_SHARP_PATH/../" && npm i sharp@latest - If you cannot upgrade
sharp, you can instead disable AVIF by configuringformatsin yournext.config.js
After choosing an option above, reboot the server by running either next dev or next start for development or production respectively.
Note: This is not necessary for Vercel deployments, since
sharpis installed automatically for you.