DEV Community

Abayomi Olatunji
Abayomi Olatunji

Posted on

How to fix Nextjs image not loading on production

Hello devs,
I recently faced an issue around images not loading on production but working perfectly well on locals.

Accessing the image on production gives this error message

"url" parameter is valid but upstream response is invalid

For the above error, irrespective of the version you are running on, kindly install sharp and that is all!

npm i sharp
Enter fullscreen mode Exit fullscreen mode

or

yarn add sharp
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay