question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

routing does not work on GitHub Pages

See original GitHub issue
  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?) any
  2. Versions. Please run ng --version. If there’s nothing outputted, please run in a Terminal: any
  3. Repro steps. Was this an app that wasn’t created using the CLI? What change did you do on your code? etc. The app was fully created with the angular-cli
  4. The log given by the failure. Normally this include a stack trace and some more information. Error 404
  5. Mention any other details that might be useful. I have an Angular 2 App deployed via GitHub Pages (using the CLI) here, whether you refresh the page or navigate using deep linking it does not work and an Error 404 from GitHub is given. I have used the CLI to generate the routes and used the new router (not the router-deprecated).

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
kutyelcommented, Jun 7, 2016

@filipesilva you are right, I will keep track of the changes made to the new router, thanks! 👍

1reaction
filipesilvacommented, Jun 3, 2016

I’ll pick this up. There is a solution in https://github.com/angular/angular-cli/issues/41#issuecomment-208456482 but I haven’t implemented it yet.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Router not working with Github Pages - Stack Overflow
Solution: I resolved the above problem by using <HashRouter/> and adding the homepage tag in the package. json like homepage: "/<repository- ...
Read more >
Problem with react-router app and Github Pages (Solved !)
The solution is to change our path of the route in our app: import './App.css'; import {BrowserRouter as Router,Switch,Route} from 'react-router ...
Read more >
How to Deploy a Routed React App to ... - freeCodeCamp
☝️ Make sure to mark your repository as public. If you mark it as private, you won't be able to use GitHub Pages....
Read more >
How to handle routes in Github Pages? : r/reactjs - Reddit
I have a react website published on github pages, my hompage and repository is /websiteName. so it's working when I'm at the hompage,...
Read more >
Using React Router on GitHub Pages - Medium
A guide to making sure your routes work once deployed and support direct URL navigation and a hard refresh. This guide assumes an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found