Menu

[Solved] React app bundled with Parcel would not deploy correctly in GitHub Pages

DEV Community: parcel·Gabriel Diem·6 months ago
#Q3kuL0RV
#dev#class#code#highlight#github
Reading 0:00
15s threshold

I was learning ReactJS, making my first dynamic-ish frontend and I was happy enough with that little project as a first React project. It worked perfectly in the local dev server provided by Parcel. I bundled the project and run a simple HTTP Python local server with the command:

python - m http . server 3000

It worked perfectly.

So I was ready to deploy the app in GitHub Pages, see if I could even do that. I pushed the changes and the dist folder as well, configured a default GitHub Actions script for a static webapp deployment and waited. It did not work, the js and css files were not being received and the console showed a couple of 404 errors. I found out that the page was trying to pull files from my root url, that being https://gabrieldiem.github.io .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.