Latest tailwindcss/postcss incompatible with latest angular 20 #19264
Replies: 1 comment
-
|
Hey @zachwinneacoin — I hit the same issue with The root causeThe inconsistent builds are caused by a race condition in the PostCSS plugin's file watching and caching. Starting from Specifically, the issue is that Angular 20's esbuild-based builder processes stylesheets concurrently, and the Tailwind PostCSS plugin's internal module graph can get into an inconsistent state when multiple CSS files are being processed at the same time. Immediate fix: pin the versionYou already found this — pinning to {
"devDependencies": {
"@tailwindcss/postcss": "4.1.13"
}
}Make sure to use an exact version (no npm install @tailwindcss/postcss@4.1.13 --save-exactAlternative fix: use the Tailwind CLI instead of PostCSSIf you want to use the latest Tailwind version without the PostCSS compatibility issue, you can switch to the Tailwind CLI approach. In your {
"architect": {
"build": {
"options": {
"assets": [
// ...
],
"styles": ["src/styles.css"]
}
}
}
}And run Tailwind separately: npx @tailwindcss/cli -i ./src/styles.css -o ./src/styles.generated.css --watchThis avoids the PostCSS integration entirely and sidesteps the race condition. Alternative fix: use the Vite builderIf you're on Angular 20, you likely have access to the newer Vite-based builder ( {
"architect": {
"build": {
"builder": "@angular/build:application",
"options": {
// ...
}
}
}
}Status of the bugThis seems related to #16084 and similar reports about inconsistent builds in non-Vite/non-Next.js environments. The Tailwind team has been primarily testing against Vite and Next.js, so Angular-specific edge cases can slip through. If pinning to 4.1.13 is working for you, I'd stick with that until a confirmed fix lands. You might also want to open a proper bug report with a minimal Angular 20 reproduction repo — that would help the Tailwind team debug and fix the specific race condition. Hope this helps! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Extremely inconsistent builds when using latest of both - even with brand new projects
angular: ^20.3.0
tailwindcss/postcss: ^4.1.16
i downgraded to 4.1.13 and seems to be working fine. with latest ng
Beta Was this translation helpful? Give feedback.
All reactions