Reputation: 23
I deployed my repo on github pages at https://jee3153.github.io/WhatToWeather-react/ , it successfully deployed. However, images are not.
And I noticed one thing, all the code is downloaded from my repo. e.g main.2473esf.chunk.js is pointing to: "https://jee3153.github.io/WhatToWeather-react/static/js/main.2473esf.chunk.js" to be downloaded
But images are pointing to: "https://jee3153.github.io/images/weather/dkfjlie.svg" like that.
Is there some kind of rule where to put your image files in? I don't know what I'm doing wrong.
Any help would be appreciated. Thanks
I have looked up documents of create-react-app but no info about images not loading.
.
Upvotes: 1
Views: 1084
Reputation: 157
Are the images in your build folder? If they are outside of your SRC during build time, they will not be included during build time. It's recommended to make an assets folder and point to your images in that folder. CRA ignores any files outside of the SRC folder during build time, including the public folder.
Upvotes: 1