Next.js Discord

Discord Forum

I'm getting the error "app-index.js:33 Warning: Extra attributes from the server: class,style"

Answered
treconyl posted this in #help-forum
Open in Discord
Avatar
I'm getting the error "app-index.js:33 Warning: Extra attributes from the server: class,style" when using the package "next-themes": "^0.3.0"

The specific error is here, next-theme automatically adds these 2 attributes to the <html tag automatically class="light" style="color-scheme: light;" causing this error, but when I add it manually, when changing dark-mode or light-mode, it displays the above error, does anyone have this problem like me and how to fix it

<html lang="vi" >
<body>
<Providers>
<div className={${inter.className} dark:bg-black bg-white text-sm}>
{children}
</div>
</Providers>
</body>
</html>
Image
Answered by James4u (Tag me if needed)
View full answer

7 Replies

Avatar
Bhotia
Where you able to fix the issue ? I have the same problem
Answer
Avatar
@Bhotia @treconyl
Avatar
<html suppressHydrationWarning> be resolved
Avatar
mark solution if it helped you!
@treconyl
Avatar
thanks y @James4u (Tag me if needed)