Skip to content

Render a real 404 page for unknown routes#14

Open
KonstantinMB wants to merge 1 commit into
masterfrom
fix/404-page
Open

Render a real 404 page for unknown routes#14
KonstantinMB wants to merge 1 commit into
masterfrom
fix/404-page

Conversation

@KonstantinMB
Copy link
Copy Markdown
Owner

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 NotFoundPage as the final route inside the Layout block, so:

  • The nav stays visible — users can recover
  • The page suggests the 5 most-useful destinations
  • Has a hacker-style `$ cd /bad-path → error: no such file or directory` header that matches the rest of the design
  • Sets <title>404 Not Found — ExploreYC</title> and <meta name=\"robots\" content=\"noindex\"> so search engines don't index dead routes

Files

File What
frontend/src/pages/NotFoundPage.tsx New component
frontend/src/App.tsx Import + catch-all <Route path=\"*\"> as last child of the Layout route

Test plan

  • cd frontend && npm run dev then visit `http://localhost:5173/this-does-not-exist\` — see the 404 page with nav
  • Visit each of the suggested links from the 404 — they all work
  • Visit a real route like `/companies` — still works (no regression)
  • View source: `<title>` is `404 Not Found — ExploreYC`

Production 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

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>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
exploreyc Ready Ready Preview, Comment May 19, 2026 7:49am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unknown routes render a blank page instead of a 404

1 participant