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

Duplicate Requests in Next.js 14 on Server Side with Parallel Routes and Intercepting Routes #66418

Open
Semmy99 opened this issue May 31, 2024 · 0 comments
Labels
bug Issue was opened via the bug report template. Developer Experience Issues related to Next.js logs, Error overlay, etc. Parallel & Intercepting Routes Related to Parallel and/or Intercepting routes.

Comments

@Semmy99
Copy link

Semmy99 commented May 31, 2024

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/nextjs-test-forked-rrpt2x?file=%2Fpackage.json%3A12%2C4-14%2C23

To Reproduce

  1. Set up a Next.js 14 project.
  2. Create a use server component that makes a request.
  3. Use parallel routes and intercepting routes in your application.
  4. Run the application in development mode (npm run dev).
  5. Observe duplicate requests being made.

Additional details from discussion:

  • When using the @modal folder, the issue occurs. Removing the @modal folder resolves the issue.

example

Current vs. Expected behavior

Current Behavior:
Requests in use server components are being duplicated when using parallel routes and intercepting routes in development mode.

Expected Behavior:
Requests should only be made once, avoiding duplicates.

Provide environment information

winwos 10,
node v20.11.1,
next "14.2.1",
react "^18",
react-dom "^18"

Which area(s) are affected? (Select all that apply)

Developer Experience, Parallel & Intercepting Routes

Which stage(s) are affected? (Select all that apply)

next dev (local), next build (local), next start (local)

Additional context

I have encountered an issue where requests in use server components are being duplicated when using parallel routes and intercepting routes in Next.js 14. If I remove the @modal folder, the problem disappears. This suggests a bug related to parallel routes and intercepting routes in Next.js.

Example discussion link: #66384

Steps to resolve suggested in the discussion, such as running in production mode, did not fix the issue.

@Semmy99 Semmy99 added the bug Issue was opened via the bug report template. label May 31, 2024
@github-actions github-actions bot added Developer Experience Issues related to Next.js logs, Error overlay, etc. Parallel & Intercepting Routes Related to Parallel and/or Intercepting routes. labels May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. Developer Experience Issues related to Next.js logs, Error overlay, etc. Parallel & Intercepting Routes Related to Parallel and/or Intercepting routes.
Projects
None yet
Development

No branches or pull requests

1 participant