Deep linking appears to be broken when building with a --public-url and useBrowserHistory: true,
See original GitHub issueHello,
I have the following project: https://github.com/nulogy/design-system
I am deploying my project to Github pages using the /docs
in master
branch strategy.
In order to achieve this I specify the --out
and --public-url
in my build script in package json:
"scripts": {
"start": "catalog start",
"build": "catalog build --out docs/ --public-url /design-system"
},
I also have useBrowserHistory: true
specified in my catalog config.
Now when I run in dev mode using yarn start
everything is fine. I can visit either http://localhost:4000/ or a sub-page http://localhost:4000/foundation/principles for example with no problem. I can hit refresh on either of these pages and everything works.
When I build and deploy however the deep links are broken. I can visit https://nulogy.github.io/design-system/ just fine, but if I deep link to (or refresh on) https://nulogy.github.io/design-system/foundation/principles I get a 404:
It seems like there may be a misconfiguration in React Router?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
@theinterned I already did 😄 https://docs.catalog.style/configuration/other#routing
Yes, unfortunately GH Pages doesn’t support this. We switched from GH pages to Netlify a while ago for this reason (amongst others). You can also host on now, Surge, or any other web server that you can configure.