1

I have been trying to deploy a nextjs website on netlify. Everything is working fine on my local host. But when hosted on Netlify the background image url is changing and the background image is not visible.

original -> background-image: url(./../../../public/drImage.jpg); when I "inspect" the hosted site on chrome background-image: url(webpack:///mini-css-extract-plugin/_next/static/media/drImage.be718e5f.jpg);

couldn't find any solution anywhere

Though changing the url by inspecting the hosted site on chrome gives the image perfectly.

1 Answers1

0

All static images begin from public so you can just name the image/directory after public.

Remove the "../" So just the path to the image, in this case "drImage.jpg"

Moseby
  • 1