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?
#Static image paths not detected in build
5 messages · Page 1 of 1 (latest)
Serving public assets should be absolute paths i.e. / not ./
Yes @floral drift is right.
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’ ?
Based on the docs it should be '/img1.jpg'
https://nuxt.com/docs/getting-started/assets#public-directory