Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigating directly to a page leads to a 404 #25

Open
MoralCode opened this issue Dec 1, 2020 · 4 comments
Open

Navigating directly to a page leads to a 404 #25

MoralCode opened this issue Dec 1, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@MoralCode
Copy link
Owner

MoralCode commented Dec 1, 2020

To Reproduce
Steps to reproduce the behavior:

  1. click this link to https://web.classclock.app/settings.html

Expected behavior
Either settings page should be visible if you have already selected a school or you should see a prompt to select a school.

Actual behavior
404 Error

this seems to be an issue with the redux-first routing model that classclock uses.

this card on the roadmap partly references this problem, but is also combined with the issue of needing to automate builds

@polygonnedpotato
Copy link

the reason this happens is because there is no context to opening the file. this means that It can't be opened because it should not even be ready.

@MoralCode
Copy link
Owner Author

MoralCode commented Dec 1, 2020

you mean like this? https://stackoverflow.com/questions/46056414/getting-404-for-links-with-create-react-app-deployed-to-github-pages#46060999 or https://create-react-app.dev/docs/deployment/#serving-apps-with-client-side-routing

When you enter a new URL into address bar of the browser or refreshes the page, browser requests server (in this case GitHub pages server) for that URL. At this point, client side router (react-router) can't take action as it is not yet loaded for that page. Now server looks for a route that matches /accounts won't find it (because routing is done on client side) and returns 404.

Get GitHub pages to redirect to index.html on all requests. Basically you have to add a 404.html in your build directory with code to redirect to index.html. More on how to do that.

@MoralCode MoralCode added bug Something isn't working help wanted Extra attention is needed labels Dec 1, 2020
@MoralCode
Copy link
Owner Author

switching from universal-router to https://github.com/mksarge/redux-json-router#usage may also fix this and provide additional benefits like allowing for a wildcard route path that can lead to a custom classclock-style 404 page on invalid routes.

@MoralCode MoralCode added this to the MVP milestone Jan 6, 2021
@MoralCode MoralCode removed the help wanted Extra attention is needed label Sep 5, 2021
@MoralCode
Copy link
Owner Author

This is fixed in the dev branch and will be part of the next release

@MoralCode MoralCode modified the milestones: MVP, General Usability Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants