routing does not work on GitHub Pages
See original GitHub issue- OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
any
- Versions. Please run
ng --version
. If there’s nothing outputted, please run in a Terminal:any
- 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
- The log given by the failure. Normally this include a stack trace and some more information. Error 404
- 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:
- Created 7 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@filipesilva you are right, I will keep track of the changes made to the new router, thanks! 👍
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.