#images in public forlder?

1 messages · Page 1 of 1 (latest)

glossy latch
#

My images are stored in public/images/my-image.jpg

Is there a problem with that?
My app is deployed to netlify from it's gihub repo. But the deploys fail with an error saying :
[vite]: Rollup failed to resolve import "images/enveloppe.jpg" from "pages/contact.vue".
10:30:41 PM: This is most likely unintended because it can break your application at runtime.

It works fine locally, but won't deploy to netlify.

Any idea?

thanks!
eric

visual marten
#

how do u use image inside contacts.vue @glossy latch

glossy latch
#

<img src="images/deco/enveloppe.jpg" >

visual marten
#

<img src="/images/deco/enveloppe.jpg" >

#

try this

glossy latch
#

oh with an extra / in front?

visual marten
#

yes

glossy latch
#

ok I'll add / on all images then. Do you know why it works locally but not on netlify?

visual marten
#

yes prolly coz build script is getting paths

#

and without slash it cannot find it

#

while dev prolly finds on runtime

glossy latch
#

ooh. ok. thanks! I'll correct my files!

glossy latch
#

Great! It works now!! thank you so much!!