-
Notifications
You must be signed in to change notification settings - Fork 28.3k
Webpack hydration freeze and debug. #72243
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
Comments
So I continued to play with it and tried a bunch of different things, I decided to downgrade VS-Code to January 2024 build (1.86.2) because like I said before, I didn't have this problem in the past. |
I don't believe the hydration error is VSCode related, but likely some race condition in the webpack implementation, as I've also been having these issues, and the hydration error was broken before updating. |
From what I could tell, at least in my case the hydration error and the debug error were caused by the same thing. |
Hello, I was having the same problem, I think the problem was I had to download the vscode version, it worked for me, you can try it too, good luck. Version: 1.84.2 |
I was having the same problem. Just by commenting {
"version": "0.2.0",
"configurations": [
{
"name": "Next.js: debug server-side",
"type": "node-terminal",
"request": "launch",
"command": "npm run dev"
},
{
"name": "Next.js: debug client-side",
"type": "chrome",
"request": "launch",
"url": "http://localhost:3000"
},
{
"name": "Next.js: debug full stack",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/node_modules/.bin/next",
"runtimeArgs": ["--inspect"],
"skipFiles": ["<node_internals>/**"]
// "serverReadyAction": {
// "action": "debugWithEdge",
// "killOnServerStop": true,
// "pattern": "- Local:.+(https?://.+)",
// "uriFormat": "%s",
// "webRoot": "${workspaceFolder}"
// }
}
]
}
Just for sharing my thought, I'm assuming the issue might be caused by some library that has to be loaded in client components. For example, my project has RecoilRootProvider in // layout.tsx
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="ko">
<body className={notoSansKr.className}>
<MSWComponent />
<ConfigProvider
theme={{
token: { colorLink: 'inherit' },
components: {
Table: {
headerBg: '#F4F5F8',
headerBorderRadius: 0,
borderColor: '#CDD1D9',
},
Collapse: {
contentBg: '#f5f5f5',
contentPadding: 0,
headerBg: '#ffffff',
borderRadiusLG: 0,
},
},
}}
>
<RecoilRootProvider>
<ReactQueryProvider>
{/* <CheckAuth /> */}
<AntdRegistry>{children}</AntdRegistry>
</ReactQueryProvider>
<ModalProvider />
</RecoilRootProvider>
</ConfigProvider>
</body>
</html>
);
} |
Just double checked and vscode debugging for both Node.js and Browser works correctly with Turbopack now. Some changes were landed in 15.2/15.3. For Windows there's a fix on next@canary that will go out soon. |
Link to the code that reproduces this issue
https://github.com/ItzzLincler/next-bug
To Reproduce
create a new next app 14@latest / 15.0.2
run 'full stack debug'
UPDATE: while I was creating a new project to upload for the reproduction of the bug. I managed to deduce that my hydration problem only occurres when there is a breakpoint on the client side (even though VS-code shows it isn't binding). maybe my vs-code is borked, I tried uninstalling a bunch of extensions but that didn't solve it either...
I don't know what else used to work fine in the past. I haven't touched next in a few months. v14 used to work fine on my PC.
I have no idea if you can reproduce it, but I don't know what to do at this point. I wasted so much time trying to play with the packge/launch.json to get it to work but to no avail....
Current vs. Expected behavior
When you run dev mode without turbo next is extremely slow at compiling a page and when you go to the page is stuck at hydration and is not responding to any input.

When you run it with turbo next works as expected but client-side debugging doesn't work from VS-Code, It only works when you place a breakpoint in the developers tab of the browser.
Provide environment information
Which area(s) are affected? (Select all that apply)
Developer Experience, Turbopack, Webpack
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
No response
The text was updated successfully, but these errors were encountered: