Duplicate Requests in Next.js vs 14 on server side with Parallel Routes and Intercepting Routes #66384
Replies: 3 comments 3 replies
-
I think your environment is in development mode, causing components to render twice due to React's Strict Mode. This might be causing the fakeRequest function to be called twice. To resolve the issue, try testing in production mode. pnpm build && pnpm start |
Beta Was this translation helpful? Give feedback.
-
Having the same issue here. When using parallel routes and rendering them in the layout component, requests are doubled for some reason. For me it happened when using two or more parallel routes. transforming the routes back to basic components solved the issue. |
Beta Was this translation helpful? Give feedback.
-
Did you solve this problem? i have this problem too.. :( |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I'm using Next.js 14 and encountering an issue where my requests are being duplicated when using parallel routes and intercepting routes.
I'm not using useEffect and the RootLayout component is only supposed to render once. However, the fakeRequest is being made twice. What could be causing these duplicate requests and how can I prevent them?
I've discovered that a problem arises when using parallel routes and intercepting routes in Next.js.
Any insights or solutions would be greatly appreciated!

Additional information
No response
Example
https://codesandbox.io/p/devbox/nextjs-test-fkl7l5
Beta Was this translation helpful? Give feedback.
All reactions