-
Notifications
You must be signed in to change notification settings - Fork 26.1k
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
[NEXT-1125] Misleading deopted-into-client-rendering warning on build #48442
Comments
Having the same issues after updating to 13.3/canary. #48404 this is probably the root cause if you are also using route groups. |
Same issue here, all my pages (inside of groups) give me this same error/warning and 0B size. |
Same issue here. I think it's due to having a "use client" component in my root layout? |
@RyanGaudion I think in that case it's normal that you deopt into client rendering yes... :) |
@Nickman87 my understanding of this from here was that client components were "prerendered on the server and hydrated on the client" and hence the page should still be able to be pre-rendered on server and only add interactivity to my cookie banner (client component referenced in the root layout) on client side" however I get this warning:
Sorry for my misunderstanding but should this be the expected behaviour that the whole page is no longer able to be pre-rendered due to a single client component that is used in the root layout? |
@RyanGaudion root layout can't be a client component that's in docs, hovewer if you are getting this error and you are not using useSearchParams anywhere or they are wrapped in Suspense/Dynamic Rendering this should not be happening. It started doing this on 13.3 try using 13.2 to see if it's still there. I think the root cause here are the route groups |
I'm seeing this warning as well, but only on routes that don't use the |
I can confirm this. The route group causes the warning to appear |
Issue resolved for me by wrapping my analytics component (in the root layout) in a suspense boundary |
I have the same problem as @RyanGaudion And when if I leave my client side components in my layout and my page. My pages are still rendered on the server looking into the HTML that is coming back. Something is definitely odd here with the warning. |
In my case the cause of problem was client side component for parsing analytic params from url. The component was called in root layout. After adding it I got this warning for every page. After wrapping it into suspense everything is fixed. |
I immediately started experiencing this client-side deopting warning after I upgraded to v13.3 and higher. I wasn't using useSearchParams and because I had no errors before the upgrade, I was quite confused what the issue was. I attempted all the solutions including suspense boundaries and removing the use of cookies(). Only solution that worked was to export dynamic=force-dynamic in my /dashboard layout.tsx to force dynamic rendering. I was not satisfied with the fact I had to resort to this solution so after tracking my deployments, I noticed the major change I made was the version upgrade. Once I downgraded to 13.2, the warnings disappeared. Also note that I was using route groups in v13.2 as well as v13.3 and above. Edit: Important discovery. |
Still having this issue on 13.4 |
In my case, I also use route groups and noticed this behavior in 13.4. After opting all routes into the Edge runtime (via exporting |
My case was using supabase that used headers() when creating the client. |
I started to have the same problem in every route. I also tried to wrap the The thing is that if i check the page source i still see the html being sent. |
I have this warning when I have a "Link" component inside my static page. And when I hover it - I see the warning. I mean it's expected, right? When I set prefetch={false} to the link - the warning is gone |
Hello guys, I found out other ways that would cause that warning, if you guys could check my issue out it might be able to solve your problems |
I was experiencing the same and solved it by wrapping my client components in Root Layout with Suspense. I'm on v13.4 |
import getMarketingConfig from "@/config/marketing" interface MarketingLayoutProps { export default async function MarketingLayout({
) Here is a problem, when I have await getCurrentUser issue stays no matter what, I don't know how I can wrap it to suspense |
Tracked this down to an accidental conflict between two error digests. Fixed it in #50219. It would specifically incorrectly show up when calling cookies / headers and such. |
## What? Ensures `NEXT_DYNAMIC_NO_SSR_CODE` has a unique error code value, this accidentally had the value for dynamic server usage (e.g. calling cookies()) which caused the warning to be shown as shown in #48442. ## How? Changed the digest value to something unique. Fixes NEXT-1125 Fixes #48442 <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation or adding/fixing Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # -->
## What? Ensures `NEXT_DYNAMIC_NO_SSR_CODE` has a unique error code value, this accidentally had the value for dynamic server usage (e.g. calling cookies()) which caused the warning to be shown as shown in vercel#48442. ## How? Changed the digest value to something unique. Fixes NEXT-1125 Fixes vercel#48442 <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation or adding/fixing Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # -->
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 22.2.0: Fri Nov 11 02:03:51 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T6000 Binaries: Node: 19.5.0 npm: 9.3.1 Yarn: 1.22.19 pnpm: 8.2.0 Relevant packages: next: 13.3.1-canary.8 eslint-config-next: N/A react: 18.2.0 react-dom: 18.2.0
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true)
Link to the code that reproduces this issue
https://stackblitz.com/edit/vercel-next-js-f51au5 (you may have to download locally; I couldn't get next build to run in stackblitz)
To Reproduce
If the root page or layout calls headers() or cookies() outside of any Suspense boundary, then
next build
outputs this warning for each affected page:If it's the root layout that uses that dynamic data, it prints this for every single route.
While it's true that the page can't be statically generated, it's not true that it all deopted into client-side rendering. The page does SSR just fine.
Describe the Bug
Error message is misleading.
Expected Behavior
The error should not appear, or should have different text.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
NEXT-1125
The text was updated successfully, but these errors were encountered: