Render a real 404 page for unknown routes#14
Open
KonstantinMB wants to merge 1 commit into
Open
Conversation
Unknown URLs previously rendered as a 200 with an empty body — typos and stale shared links landed users on a blank page with no nav and no way to recover. Adds NotFoundPage as the last route inside the Layout block so the nav is preserved and the user can navigate out. Closes #12 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #12.
Unknown routes (typos, stale shared links, anything React Router doesn't have a matching route for) previously rendered as a 200 with an empty body. Users landed on a blank cream-colored page with no nav and no way to recover.
This adds
NotFoundPageas the final route inside theLayoutblock, so:<title>404 Not Found — ExploreYC</title>and<meta name=\"robots\" content=\"noindex\">so search engines don't index dead routesFiles
frontend/src/pages/NotFoundPage.tsxfrontend/src/App.tsx<Route path=\"*\">as last child of the Layout routeTest plan
cd frontend && npm run devthen visit `http://localhost:5173/this-does-not-exist\` — see the 404 page with navProduction verification
Tested the bug live via gstack: `https://exploreyc.com/this-is-not-a-real-page\` returns 200 with `body.innerHTML.length=31` today. After this PR ships and Vercel rebuilds, that URL should render the new 404 page.
🤖 Generated with Claude Code