Browser not showing images folder from react build
My images folder from React's build folder is not showing in the browser's sources files: http://54.212.156.118/.
This is a mern stack project.
Welcome to Proshop
Find the best products for the cheapest prices.
2 Replies
I don't use react, but is the images folder in public?
Maybe also (for others) show the way you include the images and show the folder structure
It’s inside the react build.
Here's how I serve the react build:
And my folder structure is:
I notice if I go to the network tab on dev tools, it does show it fetched the images with a status code of 304 & if I try to open one in a new tab, it will show the images folder under the sources tab, but the image file itself will be the index.html file.
So I also noticed that in the headers of my fetched requests, in the dev tools, the main chuck files for css & js come from:
Request URL: http://54.212.156.118/api/static/js/main.6f284354.chunk.js
I took a look at what shows up for an image file: Request URL: http://54.212.156.118/images/playstation.jpg
So don't know if this is correct.
If I type /api
before the route path for the fetched image, then it shows up correctly & then the sources files is reorganized, showing the structure:
So for some reason, the images are being fetched without the /api
path.
I just noticed that these fetched images come from the public folder of my folder structure, inside the create-react-app folder structure.