Difficulty in deploying react app on GitHubPages

Repo: https://github.com/Karan-Ghatt/new-app
Website: https://karan-ghatt.github.io/new-app/

I’m having some difficulty in deploying a simple react app.
I went through the steps of creating my repo, going though the whole npm run build and npm deploy, I made sure to change the relevant aspects of the package.json file.

So I manage to get the page hosted through GitHubPages, but my JS. doesn’t seem to run! There’s meant to be a whole visual element on the page with buttons, but alas, they are no where to be found.

I’ve check the .chunks.js in static/.js files referenced in the index.html file, and it seems to have my code for the JS elements, but it again, it dose not appear on the page.

It’s like 2am and I could really do with some help please!!

Thank you!

Hi, @Karan-Ghatt!

It looks like the trouble here might be due to some broken URLs in your HTML. For example, this line of your index.html file includes the value href="/Karan-Ghatt/new-app/manifest.json":

Your site is published at https://karan-ghatt.github.io/new-app/, not https://karan-ghatt.github.io/Karan-Ghatt/new-app/, as the above URL implies. Correcting these broken URLs, likely through a single configuration value in your React project, should resolve this trouble.

As a side note, I uncovered this trouble by looking for 404s in the Chrome developer console, while viewing your published site. If you’re not familiar with the Chrome developer console, I’d highly recommend checking it out, as it’s a great tool for debugging exactly this sort of trouble:

I hope that helps!

Friday

1 Like

Thank you for the insight!!
I’m still a little new to react, I’m not too sure what you mean by configuration value?

Could you help me whats wrong with the URLs above, what is it that makes them broken?

I apprentice this may be pretty simple stuff, so thanks again for your time!