You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I saw the documentation saying that "Don't use props to build class names dynamically", but It seems a bit unconventional that console.log could also cause a crash.
The text was updated successfully, but these errors were encountered:
Autumnal-Joy
changed the title
detecting classes in source files causes crash
Bug: Detecting classes in source files causes crash
Mar 8, 2025
Yes, it will still cause a crash since Tailwind can't differentiate how a string is used. It only sees that it exists. This is because it doesn't run your code. Rather, it scans the code as plain text files. Thus it sees bg-[${c}] as a valid class string, which then causes invalid CSS to be built later.
What version of Tailwind CSS are you using?
4.0.11
What build tool (or framework if it abstracts the build tool) are you using?
"next": "15.2.2-canary.3"
What version of Node.js are you using?
v20.18.0
What browser are you using?
Chrome
What operating system are you using?
Windows
Reproduction URL
https://github.com/Autumnal-Joy/tailwindcss-bug-reproduce
Describe your issue
Crash
I saw the documentation saying that "Don't use props to build class names dynamically", but It seems a bit unconventional that
console.log
could also cause a crash.The text was updated successfully, but these errors were encountered: