4

I have published my app successfully on GitHub pages, but my website is not displaying anything.

This is my GitHub repository link: https://github.com/chirag299051/Ice-and-Fire

Errors I am getting in console:

inline.318b50c57b4eba3d437b.bundle.js Failed to load resource: the server responded with a status of 404 ()
polyfills.b6b2cd0d4c472ac3ac12.bundle.js Failed to load resource: the server responded with a status of 404 ()
scripts.e2cc764d74d6cb8d1c42.bundle.js Failed to load resource: the server responded with a status of 404 ()
main.54e8c9147109b23af744.bundle.js Failed to load resource: the server responded with a status of 404 ()
styles.a9b0b1037568d3083749.bundle.css Failed to load resource: the server responded with a status of 404 ()
polyfills.b6b2cd0d4c472ac3ac12.bundle.js Failed to load resource: the server responded with a status of 404 ()
scripts.e2cc764d74d6cb8d1c42.bundle.js Failed to load resource: the server responded with a status of 404 ()
main.54e8c9147109b23af744.bundle.js Failed to load resource: the server responded with a status of 404 ()
styles.a9b0b1037568d3083749.bundle.css Failed to load resource: the server responded with a status of 404 ()
Bulat
  • 720
  • 7
  • 15
chirag
  • 95
  • 1
  • 7

1 Answers1

9

Your scripts reside in https://chirag299051.github.io/Ice-and-Fire whereas your app is trying to fetch them from https://chirag299051.github.io/.

Make it so that you're fetching scripts from https://chirag299051.github.io/Ice-and-Fire.

For instance, https://chirag299051.github.io/main.54e8c9147109b23af744.bundle.js should be https://chirag299051.github.io/Ice-and-Fire/main.54e8c9147109b23af744.bundle.js.

You can set these paths by building your project with the --base-href flag and setting the <base href> tag in your index.html, see the documentation for more information.

In your cases this results in

ng build --base-href=/Ice-and-Fire/

and an index.html that looks like this

<html>
  <head>
    <base href="/Ice-and-Fire/">
    ...
  </head>
  <body>...</body>

</html>
Simeon Nedkov
  • 1,097
  • 7
  • 11