Skip to content

Compiler generating invalid syntax that throws on NextJS #16559

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

Closed
brunnobb opened this issue Feb 15, 2025 · 2 comments
Closed

Compiler generating invalid syntax that throws on NextJS #16559

brunnobb opened this issue Feb 15, 2025 · 2 comments

Comments

@brunnobb
Copy link

What version of Tailwind CSS are you using?

v4.0.6

What build tool (or framework if it abstracts the build tool) are you using?

NextJs

What version of Node.js are you using?

v22

What browser are you using?

Chrome

What operating system are you using?

Windows

Reproduction URL

https://github.com/brunnobb/nextjs-tailwind4-error

Describe your issue

Just created a brand new NextJS V15 (same happens on V14) and installed tailwind.
If using turbopack (--turbo on npm run dev) tailwind is generating invalid syntax code

Error does not happen when using webpack. (turbopack check for this invalid syntax)
You can even test on code that is commented out due to the compiler scanning possible tokens

Image

That throws an error

Image

On v3.X, I was able to use brackets syntax dynamically all over the code.
I understand that it got changed, and we should use complete class names but should this token be created in first place?

@wongjn
Copy link
Collaborator

wongjn commented Feb 15, 2025

Seems to be the same as #15853 (comment)

@philipp-spiess
Copy link
Member

Yeah indeed. That's something we're looking into right now by improving your scanner. Going to close this as a duplicate but please follow #15853 for updates very soon. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants