Search code examples
angulargithubgithub-pagesproduction

Angular 2 App Production Stuck On Loading (404 Errors)


I am trying to put an angular 2 app into production on github pages.

I am referencing the /docs folder on my master branch and have the following files in the directory

app-829a5e91692132b8e01a.js

index-3752a5a9a797ceba6259c4b27d1c4fa8.css

index.html

index.spec.js

vendor-829a5e91692132b8e01a.js

The page loads but it gets stuck on loading....

And I get the following 404 Errors.

Console Erros

I tried this on my own domain and I get the same problem so I know its not github pages.


Solution

  • You are using an incorrect <base href="/"> causing the browser to look for the files in their parent directory instead of their actual directory.

    Either adjust the base href to /pazu-prototype/ or remove it if you are not using HTML5 mode for urls.