Images not loading in Next.js application after deploy on Vercel

Viewed 1463

I'm using tmdb movie API and using Next.js getServerSideProps method I call the API and fetch the data on my website.

On localhost everything is working fine, but when I deploy my website in Vercel the images do not load properly. The URL is shown like this /_next/image?url=https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2Foriginal%2F%2F1g0dhYtq4irTY1GPXvft6k4YLjm.jpg%20&w=3840&q=75. I don't know where is the /_next?image coming from.

Can somebody help me?

enter image description here

1 Answers

I think there is a problem with the dir of your images and I had it before. Put all the images under public/static/img and create an image like below:

<img src={"/static/img/test.png"} alt="" />
Related