DEV Community

Discussion on: How to deploy React App to GitHub Pages

 
damsalem profile image
Dani Amsalem

I ran into a similar issue where my images weren't loading. After running npm run build and npx run serve and some other commands, I found that my images were looking for the path I set in step #3, setting a homepage value.

By adding the slug of my repo /my-repo to the beginning of my image relative path, I was able to see my images on my local build. Then running npm run deploy, I pushed it all back up to Github and my images showed up as intended.