Skip to content

TailwindCSS v4 - postCSS issue while running test (Jasmine and Karma) #29690

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
DSplawski-CC opened this issue Feb 21, 2025 · 2 comments
Closed

Comments

@DSplawski-CC
Copy link

DSplawski-CC commented Feb 21, 2025

Which @angular/* package(s) are the source of the bug?

Don't known / other

Is this a regression?

No

Description

Just created Angular project in webstorm and followed instruction to install and configure tailwindcss for Angular
https://tailwindcss.com/docs/installation/framework-guides/angular

It works fine in development or production, but it does not work when trying to run test via ng test (Jasmine and Karma)

`

Please provide a link to a minimal reproduction of the bug

https://github.com/DSplawski-CC/AngularTailwindCss

Please provide the exception or error you saw

`An unhandled exception occurred: It looks like you're trying to use `tailwindcss` directly as a PostCSS plugin. The PostCSS plugin has moved to a separate package, so to continue using Tailwind CSS with PostCSS you'll need to install `@tailwindcss/postcss` and update your PostCSS configuration.
`
`
at Re (F:\AngularTailwindCss\node_modules\tailwindcss\dist\lib.js:33:1716)
    at getStylesConfig (F:\AngularTailwindCss\node_modules\@angular-devkit\build-angular\src\tools\webpack\configs\styles.js:106:66)
    at async Promise.all (index 1)
    at async generateWebpackConfig (F:\AngularTailwindCss\node_modules\@angular-devkit\build-angular\src\utils\webpack-browser-config.js:74:22)
    at async generateBrowserWebpackConfigFromContext (F:\AngularTailwindCss\node_modules\@angular-devkit\build-angular\src\utils\webpack-browser-config.js:129:20)
    at async initializeBrowser (F:\AngularTailwindCss\node_modules\@angular-devkit\build-angular\src\builders\karma\browser_builder.js:109:24)

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 19.1.8
Node: 22.9.0
Package Manager: npm 11.0.0
OS: win32 x64

Angular: 19.1.7
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1901.8
@angular-devkit/build-angular   19.1.8
@angular-devkit/core            19.1.8
@angular-devkit/schematics      19.1.8
@angular/cli                    19.1.8
@schematics/angular             19.1.8
rxjs                            7.8.1
typescript                      5.7.3
zone.js                         0.15.0

Anything else?

No response

@JoostK JoostK transferred this issue from angular/angular Feb 21, 2025
@JoostK
Copy link
Member

JoostK commented Feb 21, 2025

This is expected; the webpack-based builder does not read the postcss configuration file from the workspace, only the application-builder does. Tailwind v4 support is tracked in #28938.

@JoostK JoostK closed this as not planned Won't fix, can't repro, duplicate, stale Feb 21, 2025
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Mar 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants