Images not loading after deployment
Unanswered
Barbary Lion posted this in #help-forum
Barbary LionOP
Hey guys I deployed a next app on firebase but the images are not loading.
giving me the error: Failed to load resource: the server responded with a status of 404 ()
the images are in my public folder and I am importing them like this:
import scr1 from "../public/1.png";
they are working fine in the localhost but giving me error in the deployment
giving me the error: Failed to load resource: the server responded with a status of 404 ()
the images are in my public folder and I am importing them like this:
import scr1 from "../public/1.png";
they are working fine in the localhost but giving me error in the deployment
4 Replies
@Barbary Lion
try to import it like that:
It may not work in the local env, but should work in the prod
try to import it like that:
- import scr1 from "../public/1.png";
+ import scr1 from "/1.png";It may not work in the local env, but should work in the prod
Barbary LionOP
I think it's because of the firebase
It's working just fine in vercel
It's working just fine in vercel
why do you import your image like that and not writing the path directly into your image?
@Barbary Lion ?