image not loading on vercel deployment
I m using react + vite , and the issue is that the destination page images r visible on my local host but when I deployed code on vercel the images don't load , I think it's a pathing issue but I m not sure what to do .
Deployment: https://chet-space-tourism.vercel.app/
And the GitHub for repo is : https://github.com/Chet25/spaceTourism
;-;
GitHub
GitHub - Chet25/spaceTourism
Contribute to Chet25/spaceTourism development by creating an account on GitHub.
15 Replies
how are you importing the image in your file
So I have like image files in assets > images folder
I have seperate images for seperate pages
And there's a data.json which has like paths
Depending on what u click
The path dynamically comes and shoudn technically load
try importing the image in the file you want to use , then use them
like this
import Image from "../assets/images/image.jpg"
then use it like . <img src={Image}/>
try thisSo I should import the images in file , make an array and dynamically change between them depending on my clicks
Is that possible?
I want them to change , the second nav bar switches the information
i don't really understand it but it sounds possible
As well as the image
yhyh. you can import all the images and dynamically change them
that is possible
Hm that could work thx patrick
Lemme try
yeah try and lemme know if it works. (it should)
:linux:
@patrick it worked 🔥 thx
U can see the deployment it works
yh i just checked
glad i could help
Now I have to mark this post
Solved right
probably. i'm not sure. haven't opened an issue before
Pro
oh no 😂