Replies: 68 comments 125 replies
-
The warning is only visible in the dev build. In the production build, the console is empty. I guess this is because it's only a warning and not an error. |
Beta Was this translation helpful? Give feedback.
-
Are you running any browser extensions? Same error was caused by LastPass here. |
Beta Was this translation helpful? Give feedback.
-
Thank you @michrome. I suspected some browser extension too, but I don't have LastPass and I just tried in two browsers (Safari, Brave) that I don't use regularly and have no plugins installed. Interestingly, this error and another one ("Warning: A future version of React will block javascript: URLs as a security precaution.") is in my browser console, but only the one about the javascript: URL is printed in the NextJS CLI (Dev server). How about third-party javascript that modifies the DOM and somehow injects |
Beta Was this translation helpful? Give feedback.
-
Hmm it seems to happen because I've nested
But it seems this is the correct way to do it, according to W3C: https://stackoverflow.com/questions/5899337/proper-way-to-make-html-nested-list |
Beta Was this translation helpful? Give feedback.
-
Lastpass was causing this error for me. |
Beta Was this translation helpful? Give feedback.
-
Had the same issue, gone when I deleted the comments at the css class that triggered the warning. |
Beta Was this translation helpful? Give feedback.
-
In my case, I was using normal |
Beta Was this translation helpful? Give feedback.
-
For me, the warning appears when implementing a web component which sets a "style" attribute to its tag. |
Beta Was this translation helpful? Give feedback.
-
I find if I do this, it would give this error: <div className="px-2 font-black hover:cursor-pointer hover:text-[#52E9E0]">
<a href={process.env.NEWSLETTER_WEBSITE} target="_blank">Newsletter</a>
</div> However the link is OK on the page, in the source, or in the DOM. |
Beta Was this translation helpful? Give feedback.
-
For me, the warning appears when I use a custom attribute that called as "uk-parallax" on a div.
|
Beta Was this translation helpful? Give feedback.
-
With a similar mess of errors in Remix.run I added this little snippet to silence the errors, more so than as a good solution in production. function clearBrowserPluginInjectionsBeforeHydration() {
if (document.body.dataset) {
Object.keys(document.body.dataset).map((attribute) => {
delete document.body.dataset[attribute];
});
}
setTimeout(
() =>
document.querySelectorAll("html > script, html > input").forEach((s) => {
s.parentNode?.removeChild(s);
}),
0
);
}
function hydrate() {
startTransition(() => {
clearBrowserPluginInjectionsBeforeHydration();
hydrateRoot(
document,
<StrictMode>
<ClientCacheProvider>
<RemixBrowser />
</ClientCacheProvider>
</StrictMode>
);
});
} Please don't use this in production unless you really want to kill browser plugins. |
Beta Was this translation helpful? Give feedback.
-
Disabling ColorZilla Extension solved for me. |
Beta Was this translation helpful? Give feedback.
-
I can confirm that extension After disabling it no more console.log errors. |
Beta Was this translation helpful? Give feedback.
-
Disabling Loom extension fixed it for me |
Beta Was this translation helpful? Give feedback.
-
It seems that the NextJS official documentation has some information summarized regarding this error. It would be helpful to take a look.(here : https://nextjs.org/docs/messages/react-hydration-error) |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
A |
Beta Was this translation helpful? Give feedback.
-
I'm also getting this error, it seems to have something to do with the new providers.tsx file I created, to wrap my app for NextUI.
Is there a way to resolve this yet? |
Beta Was this translation helpful? Give feedback.
-
For me it's the |
Beta Was this translation helpful? Give feedback.
-
gsap caused mine, removing the imports fixed my problem, gsap adds a style attribute to an html element in question for some wierd reason |
Beta Was this translation helpful? Give feedback.
-
I've been running into all kinds of issues with a simple server component form with a server action, and this issue on my end was caused by the Firefox extension "Textarea Cache". It's not a super popular extension but figured I'd mention in case someone else is using it. |
Beta Was this translation helpful? Give feedback.
-
I had the same problem when using bootstrap in react js. And I tried commenting(/* ... */) my elements one by one to find out what the error was. Finally , I found that the error was in the data attribute of the textarea. This is the best way I have come up with to quickly find the error 😅. |
Beta Was this translation helpful? Give feedback.
-
If you have organisational folders (folders in parentheses) and a layout.jsx/tsx in that folder, make sure you're not including HTML and Body tags in these layouts. only the rootlayout should contain these. |
Beta Was this translation helpful? Give feedback.
-
still not fixed any help? |
Beta Was this translation helpful? Give feedback.
-
I had same issue, it showed on all browsers so it wasn't any extension. |
Beta Was this translation helpful? Give feedback.
-
I got error for using next-themes for changing theme. |
Beta Was this translation helpful? Give feedback.
-
Looks like we have a good idea what causes it. How do we fix it? |
Beta Was this translation helpful? Give feedback.
-
The automatic google translate feature from Chrome caused this issue for me. This was driving me crazy. For some reason google translate detected my page as Portuguese and it was trying to translate it to English causing this bug to show up. |
Beta Was this translation helpful? Give feedback.
-
I encountered this error while using next-themes for dark mode, as instructed by Shadcn UI. I resolved it by setting a default class name and style for the system theme, which were being automatically generated by next-themes. Here’s the updated code:
After making this change, the error in the browser console was resolved. |
Beta Was this translation helpful? Give feedback.
-
I'm not very experienced with Next.js/React, please forgive me if my question is dumb.
As a first project, I tried to migrate my existing static website to NextJS. So far everything works, except one warning in the console, and I don't understand/know why it happens and where the error is.
I suspect something silly like using
class=
instead ofclassName=
, but everything seems fine. Maybe some third-party Javascript adds astyle
attribute to some node? But where?So my question is how to find that particular error. I've clicked on all those links in the console message, but I'm unable to find the root cause of it.
Beta Was this translation helpful? Give feedback.
All reactions