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

chore: migrate 404 page to App Router #18449

Merged
merged 37 commits into from
Jan 11, 2025
Merged

chore: migrate 404 page to App Router #18449

merged 37 commits into from
Jan 11, 2025

Conversation

hbjORbj
Copy link
Contributor

@hbjORbj hbjORbj commented Jan 3, 2025

What does this PR do?

  • not-found page in App Router will display the custom error page (equivalent to pages/404)
  • Remove pages/404

Tested

Light Theme

Screenshot 2025-01-10 at 1 00 42 AM

Black Theme

Screenshot 2025-01-10 at 1 02 44 AM Screenshot 2025-01-10 at 1 23 53 AM

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • N/A - I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  • Try to render not-existing pages, e.g., http://localhost:3000/event-types/123/123, http://localhost:3000/12300, etc

Copy link

vercel bot commented Jan 3, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview Jan 10, 2025 0:20am
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview Jan 10, 2025 0:20am

@graphite-app graphite-app bot requested a review from a team January 3, 2025 03:17
@hbjORbj hbjORbj changed the title chore: app router 404 page chore: migrate 404 page to App Router Jan 3, 2025
@dosubot dosubot bot added the consumer label Jan 3, 2025
Copy link

graphite-app bot commented Jan 3, 2025

Graphite Automations

"Add consumer team as reviewer" took an action on this PR • (01/03/25)

1 reviewer was added to this PR based on Keith Williams's automation.

@vercel vercel bot temporarily deployed to Preview – api January 3, 2025 03:25 Inactive
@hbjORbj hbjORbj force-pushed the chore/app-router-404-page branch from 58eb1dc to 4c892e7 Compare January 3, 2025 03:38
@@ -1,17 +0,0 @@
"use client";

import { type NextPage } from "next";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

global-error is not needed. not-found is sufficient.

Copy link
Contributor

github-actions bot commented Jan 3, 2025

E2E results are ready!

Comment on lines +178 to +189
"/signup",
"/settings/:path*",
"/reschedule/:path*",
"/availability/:path*",
"/booking/:path*",
"/payment/:path*",
"/router/:path*",
"/routing-forms/:path*",
"/org/:path*",
"/team/:path*",
"/:user/:type/",
"/:user/",
Copy link
Contributor Author

@hbjORbj hbjORbj Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All routes must be included in the middleware config because the not-found page itself bypasses middleware processing. The not-found component depends on custom headers (like x-pathname and x-locale) that we set in middleware. Therefore, to ensure these headers are properly set before the not-found page is rendered, every route needs to go through middleware first.

@keithwillcode
Copy link
Contributor

Can we actually merge this now? Before we had issues where there were 404 page conflicts and it caused problems in the app.

@keithwillcode
Copy link
Contributor

Can we actually merge this now? Before we had issues where there were 404 page conflicts and it caused problems in the app.

Examples can be found #15249 and #15696

@zomars zomars merged commit cfaefcf into main Jan 11, 2025
38 checks passed
@zomars zomars deleted the chore/app-router-404-page branch January 11, 2025 01:12
@zomars zomars restored the chore/app-router-404-page branch January 11, 2025 01:15
@zomars zomars mentioned this pull request Jan 11, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consumer core area: core, team members only i18n area: i18n, translations ready-for-e2e
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants