Closed lelabo-m closed 1 year ago
Updated to next@13.1.3 to see if I get better errors message about the hydration error.
Both the react dev overlay and inspect console seems to be the exact same...
I can't repro on either dev/prod https://github.com/awareness481/next-app-repro (here's the repo in case I didnt follow the instructions correctly)
Edit: If I reload the page and spam-click the button I can indeed reproduce the issue
I have this issue on first load as well. If it interact with the page by any means before it is fully loaded I get an error.
In dev mode:
In production mode:
If the page is very light you have to be super quick :grin:
same with me , but i have fixed it with useEffect method , my case was i fetched the data from api, then i render component conditionally, the problem was conditional render ,
Same here
Using unmodified npx create-next-app@latest --experimental-app
& npm run dev
Same problem. I get this error when I click somewhere on the Next js 13.1.6 canary default home page while the page is loading
this is awful :'(
any news on this one?
Same error here, clicking anywhere on the page
I actually dont need to click, it happens sometimes just after the page renders
On Mon, 6 Mar 2023 at 21:23, Raymond Kennedy @.***> wrote:
Same error here, clicking anywhere on the page
— Reply to this email directly, view it on GitHub https://github.com/vercel/next.js/issues/45047#issuecomment-1456921208, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEBPZCAXSXI7YHNMQLAUZG3W2ZBVJANCNFSM6AAAAAAUAPAYMA . You are receiving this because you commented.Message ID: <vercel/next. @.***>
@ItayElgazar could it be something like:
// layout.tsx
<ClientContext>
<ServerComponent2>
<ClientComponentThatConsumesContext />
</ServerComponent2>
</ClientContext>
? Just throwing out possible causes...
@franzwarning I tried removing basically every provider, layout, links and some odd components just to rule out this issue, I suspect that it happens when I fetch data using server component (with async await) 🤷♂️🤦♂️
@ItayElgazar can you replicate on codesandbox?
~@ItayElgazar I figured it out for my case -- I was importing a css file from node_module in a client component~
still haven't figured it out..
@franzwarning
Okay that's interesting! Sorry I'm afk, when I'm back I'll post here a link to codesandbox.
Can you share with me what exactly you removed? I don't think I'm using any external css other than tailwind :(
@ItayElgazar ~do you use headlessui by chance? I also noticed my <body>
was getting set with overflow:hidden
if I clicked at the right time during hydration. Hit me on telegram https://t.me/franzwarning and we can debug together, and post the result here~. Not relevant.... I have no idea what's causing this issue but it's still happening. (on focus and on click)
I get this error when I click somewhere while the page is loading
Update -- when I clear my .next cache and restart my next dev server it starts working. It could be something with the cache returning old information on dynamic pages? Doesn't explain the fact it only happens when you click though....
Updated to 13.2.3 and still experiencing the issue. Error is thrown in NotFoundErrorBoundary when interacting with input elements (focusing them) while page is still loading.
Edit: Also cleared .next cache, node_modules and package-lock, still same issue
Also seeing this. I have interleaved server component > client context > server component > client consumer components, but my understanding is this is allowed.
A fresh nextjs install and just enabling appDir causes this without doing anything else. Just press F5 over and over again (really fast).
I am running into this same issue as well. @leerob Just for kicks, I tried loading your site to test this out, and sure enough, spam clicking your page just after a reload produces the hydration error.
Most of these we've seen so far are caused by browser extensions installed which is likely why you can reproduce it on any site @Kinbaum, can you narrow down which extension is causing it?
Hey @timneutkens
I have disabled every extension, tried incognito, and multiple browsers (Safari, Edge, Chrome, Arc). Each has the same issue when spam clicking immediately after reloading. I've tried on my own site @leerob's, and the app dir playground https://app-dir.vercel.app/
Here's the result:
So what is interesting is that when looking at the network tab, after spam clicking, when the error occurs, all network traffic stops at the favicon request (does not matter which site it is). Just an observation. And when I don't spam it, I see more traffic coming in after.
Same here. Any update on this? Seems wild this has been an issue for 2 months with no fix.
@shuding @huozhi @leerob Could you guys fix this because it's been there for quite a while and it's very big problem.
a huge one honestly, because the pages become totally not functional and since this bug affects everything else, Next13 is useless because this bug
@faradaytrs @nabildroid just use dynamic imports for the client components.
const Menu = dynamic(() => import("@/components/menu"), {
loading: () => <p>Loading...</p>,
});
Just to be clear this is already triaged and being looked at. We're struggling to consistently reproduce the issue to investigate the root cause of the problem. Please be patient.
I've managed to record a replay using https://replay.io, quite certain it's something in React. Asked @acdlite to take a look.
@acdlite looked into this case and found it was accidentally fixed with some other bugfixes to React two weeks ago. I've taken @awareness481's reproduction, upgraded to next@canary
, and verified the reproduction steps and can no longer reproduce so I'm going to close this issue as fixed 👍
Codesandbox: https://codesandbox.io/p/github/awareness481/next-app-repro/csb-nhq2u0/draft/trusting-sound?file=%2FREADME.md
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: linux Arch: x64 Version: #1 SMP Wed Nov 23 01:01:46 UTC 2022 Binaries: Node: 16.13.0 npm: 8.1.0 Yarn: N/A pnpm: 7.25.1 Relevant packages: next: 13.1.3-canary.5 eslint-config-next: 13.1.3-canary.5 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
NA
To Reproduce
Create a new app:
pnpm dlx create-next-app@latest --experimental-app
Create a client component:
Add it to
page.tsx
.Run the app with:
pnpm run dev
Reload the page and click the button component as soon as available, but before the page loaded fully load.
Describe the Bug
With
pnpm run dev
:An
Unhandled Runtime Error
will happen.while in the inspect window in chrome display the following errors:
With
pnpm run build & pnpm run start
:The following error happen (which I think is the same error).
Expected Behavior
As soon as the client component render, I expect to be able to interact with them.
Which browser are you using? (if relevant)
Opera Gx / Google Chrome
How are you deploying your application? (if relevant)
next dev / next start
NEXT-855