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

Infinite Redirect Loop on 404 Page in Production #8306

Open
lorenzrabs opened this issue Sep 19, 2024 · 1 comment
Open

Infinite Redirect Loop on 404 Page in Production #8306

lorenzrabs opened this issue Sep 19, 2024 · 1 comment
Assignees
Labels

Comments

@lorenzrabs
Copy link

Link to reproduction

No response

Environment Info

Website Template
Payload: 3.0.0-beta.107

Describe the Bug

When visiting a non-existent page (404) in production, the page flickers continuously, suggesting an infinite redirect loop. The browser console shows the following error:

Server Error: NEXT_NOT_FOUND
    at PayloadRedirects (webpack-internal:///(rsc)/./src/components/PayloadRedirects/index.tsx:34:69)

This issue only appears in production mode. In development mode, the error is displayed in the console, but the 404 page loads correctly without flickering.

Reproduction Steps

  1. Use the latest website template.
  2. Seed the database.
  3. Remove the seed page redirect in [slug]/page.tsx.
  4. Visit any non-existent page in production mode.

Adapters and Plugins

No response

@lorenzrabs lorenzrabs added status: needs-triage Possible bug which hasn't been reproduced yet v3 labels Sep 19, 2024
@akhrarovsaid
Copy link

Hey @lorenzrabs,

I'm able to reproduce your issue consistently by building (via npm run build) the app and navigating to a page I know doesn't exist - triggering the 404.

I'm attaching a video of the current behavior. I haven't deployed this application, it's currently running on my local windows machine however I'm able to reproduce your issue with both mongodb and the postgres adapter. I've attached a video of the issue. Looking at console logs indicates it's an RSC problem.

chrome_2024-09-19_18-51-07.mp4

@paulpopus paulpopus self-assigned this Sep 20, 2024
@github-actions github-actions bot removed the status: needs-triage Possible bug which hasn't been reproduced yet label Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants