Routing is broken in GitHub Pages environments
jeremyckahn opened this issue · comments
Per this report, it appears that room links are broken in GitHub Pages environments.
Per the Create React App docs, the likely solution is to set an appropriate BrowserRouter
basename
.
This is working better, but GitHub Pages environments still don't work with room links in WebKit browsers. They result in broken room URLs like the one here: #167 (comment)
The code here needs to be revisited to address this:
Lines 7 to 48 in 667c0b6
I am not a javascript expert by any means. I was looking at some 404.html examples and this is different than yours:
Yours: var pathSegmentsToKeep = 0
Another: var pathSegmentsToKeep = 1;
What does the 1 over 0 do? Do you need a semi-colon? ;
Adding the ; var pathSegmentsToKeep = 0; does not change the outcome.
// If you're creating a Project Pages site and NOT using a custom domain,
// then set pathSegmentsToKeep to 1 (enterprise users may need to set it to > 1).
Are we using a custom domain? If not change to "l"?
@ralphshinevar if you'd like try an immediate fix for your fork, try changing this line: https://github.com/ralphshinevar/chitchatter/blob/e63632c0c3827980f8e8d62726ab8e30c7f8789a/public/404.html#L27
Change the 0
to 1
and commit the file (in your main
branch). That should trigger a new deployment.
Jeremy. The change to 1 apparently works. I was able to get in from my laptop and my phone! How about that? I fixed the javascript. I always say "necessity is the mother of invention."
Let's see if my testers (friends) can get in.
They seem to be busy. I guess I will go and mow the lawn. Try them later.
@ralphshinevar this should now be fully fixed. Try syncing your main
branch with mine to get up to date.