-
Notifications
You must be signed in to change notification settings - Fork 15
Double generation of CSS class names (Next.JS + Tailwind) #46
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
It seems the problem is the server side rendering vs client side rendering. Fix would be a custom classGenerator. |
i tried this
and it ran 3 times, which is probably the problem. one for edge, nodejs, and undefined (client). i tried some different scenarios so webpack only ran once. i checked the and went to the autogenerated css client
only the autogenerated css file classnames changed, but not the html classnames
only the html classnames and not the autogenerated css file classnames try something like
this will ensure the classnames are consistent and unqiue and removes the equal signs which break the css hope this helpful |
@ermaxinc @frog1123 Release the new version(5.0.9) which may fix the issue. Could you check if it works? Here it makes the ClassGenerator Instance singleton. |
Uh oh!
There was an error while loading. Please reload this page.
Hi
I use Tailwind with the prefix
tw-
In
next.config.js
:When I run a build, the css file gets double class names (check
tw-py-8
)As we see the tw-py-8 class is processed twice (
E
andYA
)So the
css file
looks like this (fortw-py-8
):As we see the
YA
class is correct (fortailwind tw-py-8
)BUT
The class
E
is inserted in the pageAs a result, the entire design does not display correctly
Any idea?
PS:
Next.js last version
Tailwind last version
The text was updated successfully, but these errors were encountered: