next-themes icon indicating copy to clipboard operation
next-themes copied to clipboard

When I add 'class' as an attribute to the theme provider I get this error. I use Nextjs with tailwindcss. Is there any hope for me?

Open AryanKuAg opened this issue 2 years ago • 5 comments

image image

If i remove the 'class' from the attribute then error gone.

AryanKuAg avatar Jul 25 '22 11:07 AryanKuAg

image I want that bg-white will normally show white background and when i do dark:bg-black, then it will show me the activated dark mode. I configured all the things as mentioned in the docs, but nothing happened. help!!!

AryanKuAg avatar Jul 25 '22 11:07 AryanKuAg

Does the base class name on your html element contain invalid characters? Sounds like the API is failing to modify the class name because the existing version is invalid? Need more info.

pacocoursey avatar Jul 26 '22 02:07 pacocoursey

image

Its a Next.js Project, Idk where is the html file, though I don't modify anything on html , I just add class as attribute and this throws an error that I mentioned above.

AryanKuAg avatar Jul 28 '22 08:07 AryanKuAg

Oh, weird. What browser are you using?

pacocoursey avatar Jul 28 '22 23:07 pacocoursey

Oh, weird. What browser are you using?

Thanks for taking interest in my problem. I'm using Brave, Chrome, Firefox and Tor.

AryanKuAg avatar Jul 29 '22 09:07 AryanKuAg

@AryanKuAg are you still seeing this issue? I really think it can only be a browser bug, or something deep inside your application code.

pacocoursey avatar Sep 22 '22 03:09 pacocoursey

@AryanKuAg Check out this small blog post: No-brainer Dark Mode for Next.js. I'm also using Next.js plus TailwindCSS*. Make sure you are following those steps.

If you still come across this issue please let me know, I'd be happy to help.

iamhectorsosa avatar Sep 26 '22 10:09 iamhectorsosa