How to make NextJs Image show in production?

Joshua Oyeleke 0 Reputation points
2024-01-30T19:20:49.97+00:00

I deployed nextjs to azure but after the build, the image sizes are 0B. Image is not showing in product but if I add the following to next.config.js file, it works: { images: { unoptimized: true } } I am using NextJs of 13.x. When I switched to version 14 also, it also did not work. This is from my package.json:

"next": "13.5.6",
"react": "^18",

image

This is a screenshot of the build output... The images are showing 0B. I guess this is the reason why they are not showing inside the webapp... but then, after adding { images: { unoptimized: true } } inside next.config.js, it all works file

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
42,834 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.