#Static image paths not detected in build

5 messages · Page 1 of 1 (latest)

slim dust
#

Hey guys! I’m a new Nuxt developer and tbh I’m relatively new to Js itself. I recently created a portfolio type website for myself using Nuxt3, Vuetify and Ts. In this website I had some v-cards showing images which I was loading from my public directory. So the path in the img tag was - “./img1.jpg”. This approach worked perfectly in the dev environment but I am unable to see these images in my build. Does anyone know why this is?

floral drift
#

Serving public assets should be absolute paths i.e. / not ./

iron elk
#

Yes @floral drift is right.

slim dust
#

So if my images are stored in a dir called ‘public’ which is in my project directory. The path to my image should be ‘public/img1.jpg’ ?

molten crest