Skip to content

Error: "Parsing css source code failed" in Tailwind V3 #18678

@NishargShah

Description

@NishargShah

What version of Tailwind CSS are you using?

TailwindCSS: v3.4.17

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

Nextjs: 15.4.5
React: 19.1.0

What version of Node.js are you using?

NodeJS: 22

What browser are you using?

Browser: Chrome

What operating system are you using?

OS: macOS

Reproduction URL

https://github.com/NishargShah/tailwindcss-v3-issue

Describe your issue

Hi Tailwind team,

I’m working on a client project where I had to change padding values for large screens (min-width: 1728px) using a custom plugin in tailwind.config.ts.

Everything was working fine until I used the --turbopack flag in the dev script.

After many hours of debugging, I found a specific issue that causes the development server to break. I also created a minimal repo to reproduce the bug.


🧩 What I Did

  1. In my tailwind.config.ts, I added a plugin to support custom padding values.

  2. In page.tsx at 7th line I used the class !pt-1.25.

    Please take a note, it only reproduce when important (!) is there, without important it will work as aspected.

  3. Then I ran this command to generate CSS:

    npx tailwindcss -i ./src/styles/globals.css -o ./src/styles/output.css
  4. When I start the Next.js dev server with --turbopack:

    next dev --turbopack

    I get a Next.js error screen, and the server fails to load the app.

  5. But if I remove !pt-1.25, everything works perfectly.

  6. Also, if I run the dev server without --turbopack, it works fine.


📸 Screenshots

Error in CSS File:

Browser error screen

Error from dev server:

Next.js error screen


🔍 What I Tried

  • I thought it might be a PostCSS issue, but not sure.
  • After testing multiple cases, the main issue is with custom value 1.25 and --turbopack in dev mode.
  • This issue does not happen in production builds, only during dev with --turbopack.

✅ Temporary Workaround

If I remove the --turbopack flag from the script, like this:

next dev

…it works fine. But I prefer to use --turbopack for better speed.


📦 Possible Cause?

It might be that:

  • 1.25 is not being processed correctly in some part of the pipeline (maybe PostCSS or internal Tailwind logic).
  • Or maybe --turbopack in Next.js is strict and crashes when there CSS syntax error.

Please check if:

  • This is a Tailwind bug or something from Next.js Turbo integration.
  • Any workaround/fix is possible for supporting custom values like 1.25.

Thanks a lot for your great work and support 🙌

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions