krishna chaitanya
krishna chaitanya

Reputation: 43

Getting blank index.html when Angular 7 deploy to github

I have deployed Angular website using Github pages. Entire process is successful but when I am opening the website its showing blank page. Its loading index.html page but still its blank. Can you please help me solve the issue.

Here is the link https://s530860.github.io/website/

https://s530860.github.io/website/

Upvotes: 1

Views: 2358

Answers (2)

Michael Kang
Michael Kang

Reputation: 52847

You also need:

--deploy-url /website/

Upvotes: 1

Sandun Isuru Niraj
Sandun Isuru Niraj

Reputation: 461

If you deploy your website other than the main domain, you need to build it with this type of command.

  • In your example I can see you have using sub directory url called /website. So run this command.

      ng build --prod --output-path docs --base-href /website/
    
  • When the build is complete, make a copy of docs/index.html and name it docs/404.html.

  • Then push your docs directory to Github.

It is clearly mentioned in the official docs.

Angular Docs - Deploying Github Pages

Upvotes: 3

Related Questions