Skip to content

Angular: Error in PostCSS + tailwind 4 doesn't break the build #18370

Open
@noguespi

Description

@noguespi

With Angular and Postcss + Tailwind 4, when I have an error in a css file, it displays a big red error in the logs, but the build continue and is done successfuly.

The expected behavior is it should break the build, so you don't ship bugged CSS. The error seems due to tailwind not reporting correctly the error to postcss.

Reproduction:

  • create a new angular project with default options.
  • npm install tailwindcss @tailwindcss/postcss postcss --force
  • create the .postcssrc.json with
{
  "plugins": {
    "@tailwindcss/postcss": {}
  }
}
  • add the follwing in the css of a component @reference "not-found.css";
  • npm run build

The error is displayed but the build continue and is successful.

Version:

"@tailwindcss/postcss": "4.1.10"
"postcss": "8.5.6"
Angular CLI: 20.0.3
Node: 20.19.2
Package Manager: npm 11.4.1
OS: linux x64

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions