-
Notifications
You must be signed in to change notification settings - Fork 402
fix(nextjs): Fix infinite redirect loop when page does not exist #5073
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
fix(nextjs): Fix infinite redirect loop when page does not exist #5073
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: 4c83ad6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| const detectedMiddelware = detectClerkMiddleware(request); | ||
|
|
||
| /** | ||
| * Prevents infinite redirects in when the `returnUrl` will result to a 404 (not-found) page. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * Prevents infinite redirects in when the `returnUrl` will result to a 404 (not-found) page. | |
| * Prevents infinite redirects when the `returnUrl` will result to a 404 (not-found) page. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's find a different approach that checks the data we're trying to sync
…n page does not exist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
Description
On keyless avoid infinite redirect loop when page does not exist and application is attempting to sync state with middleware.
Before
Screen.Recording.2025-02-03.at.6.04.01.PM.mov
After
Screen.Recording.2025-02-03.at.6.02.37.PM.mov
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change