Search code examples
reactjsdeploymentweb-deploymentnetlify

Images imported into VSCode are not showing when portfolio site deployed with Netlify


Have a few images that I've dragged into VSCode for my portfolio site that are not showing when my site is deployed to Netlify. My frontend uses React.

Continuous deployment via GitHub is working as when I push changes to GitHub they show in the deployed version.

I've tried moving the images all around whether that be within the src folder or outside of it, and also changing src file paths of images but they still aren't showing in my deployed site. They look like empty boxes instead, as shown here. When I inspect these boxes in the browser their src attribute is visible.

Here is my current file structure and perhaps where the images are is part of why the images aren't showing deployed. Images are currently in the public folder but not within the assets folder.

I also have a build folder that was created by some build command which I believe built a production version of my app for deployment.

Would appreciate any help!


Solution

  • Remove public from your path and simply put:

    <img src="taxi-715.png" /> 
    

    By default react will know it's in a public directory.