PostCSS 8 requirement even with npm:@tailwindcss/postcss7-compat
See original GitHub issueWhat version of Tailwind CSS are you using?
npm:@tailwindcss/postcss7-compat
What build tool (or framework if it abstracts the build tool) are you using?
N/A
What version of Node.js are you using?
14.17.1
What browser are you using?
N/A
What operating system are you using?
Windows
Reproduction repository
https://github.com/joshcomley/bugs-tailwindpostcss
Describe your issue
After following the guidelines on avoiding PostCSS plugin tailwindcss requires PostCSS 8.
, I still get the message.
Here is a simple repro where I am unable to compile tailwind
at all in its most basic way, even with all the correct “compat” packages installed.
To see this in action:
- Clone the repo
- Install packages
- Run
yarn build:css
Issue Analytics
- State:
- Created 2 years ago
- Reactions:7
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Error: PostCSS plugin tailwindcss requires PostCSS 8
So I had to install with yarn instead and it works. npm uninstall tailwindcss postcss autoprefixer yarn add tailwindcss@npm:@tailwindcss/ ...
Read more >@tailwindcss/postcss7-compat - npm
A utility-first CSS framework for rapidly building custom user interfaces.. Latest version: 2.2.17, last published: a year ago.
Read more >Installation - Tailwind CSS
Error: PostCSS plugin tailwindcss requires PostCSS 8. In this case, you should install the PostCSS 7 compatibility build instead.
Read more >React with Tailwind CSS - Product Engineering
Error: PostCSS plugin tailwindcss requires PostCSS 8. You can also use Tailwind CSS that supports the previous version. npm install -D tailwindcss@npm:@ ...
Read more >postcss-import 13 & tailwindcss 2 - Laracasts
I have a repository with Laravel 8 and Tailwind CSS v2, one with the backward compatible version for PostCSS 7 and one for...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I ran into this issue, too. Reverting to a version earlier than 2.2.0 does fix it.
If you need this, you can change the dependency in your
package.json
to:"tailwindcss": "npm:@tailwindcss/postcss7-compat@2.1.4"
Hey! In this case there is no reason to use the PostCSS 7 build since you aren’t actually running PostCSS yourself. To get things building in your repo you have a few options:
Just use the latest version. If you aren’t actually trying to integrate with an existing PostCSS pipeline, there’s no need to use the PostCSS 7 version:
Integrate with PostCSS in a PostCSS 7 project. If you actually are integrating with PostCSS 7, things will work since you won’t be using our CLI. Here’s an example using
postcss-cli
, it works as expected:I’ll make a note to consider replacing the CLI in the compat build with a simple script that just throws an error, since there’s no reason for our actual CLI tool to have a PostCSS 7 version.
We will be dropping PostCSS 7 support in November when Tailwind CSS v3 is release for what it’s worth, so hopefully the rest of the ecosystem (I think really just CRA) catches up by then. I’d recommend using Vite instead of CRA personally, does all the same stuff but is faster and more modern.