purgecss icon indicating copy to clipboard operation
purgecss copied to clipboard

TailwindCSS PostCSS 7 compat build dependency requiring PostCSS 8 through PurgeCSS

Open Ffloriel opened this issue 5 years ago • 3 comments

https://github.com/tailwindlabs/tailwindcss/issues/3101

Describe the problem:

It looks like @fullhuman/postcss-purgecss, which is a Tailwind dependency (^3.0.0), was updated to 3.1.0 recently. This version has purgecss@^3.1.0 as a dependency, which in turn has postcss@^8.2.1 as a dependency. So whenever I try to install the Tailwind PostCSS 7 compatibility build on a new project, I get @fullhuman/[email protected] installed, and the purge process returns an error which I have seen when using wrong versions of PostCSS and its plugins: [object Object] is not a PostCSS plugin.

Maybe locking the version to @fullhuman/[email protected] would solve the issue?

I am currently teaching Tailwind at the Open University of Catalonia (UOC) and some students are currently facing this issue. I tested the tools thoroughly when Tailwind 2 was released to make the switch for the students (which I was aware was a risky move), and it appeared to work, but it seems it broke a few days ago because of this. So could you please check if this is an issue and if there would be a quick way to fix it? (like recommending locking to @fullhuman/[email protected])

I also noted on the documentation the installation for the compatibility build was changed from npm install tailwindcss@compat to npm install tailwindcss@npm:@tailwindcss/postcss7-compat @tailwindcss/postcss7-compat. Is this related to this issue in any way?

Link to a minimal reproduction:

Reproduction steps would be installing the compatibility build on any project and checking that @fullhuman/[email protected] was installed, which has purgecss@^3.1.0 as a dependency, which in turn has postcss@^8.2.1 as a dependency.

I created this repo a week ago. You can see on the lockfile the version it got installed was @fullhuman/[email protected]. But following the same steps today (cloning this repo [a starter project based on Parcel.js v1, so using PostCSS 7 and autoprefixer 8 by default] and installing Tailwind 2 compat build on top of it) would today install @fullhuman/[email protected] which I believe causes this issue.

Ffloriel avatar Dec 23 '20 23:12 Ffloriel

Yes please! I just upgraded my personal site and I really regret doing so now as I am having the same problem.

I am receiving the same error as Ffloriel above. I tried to downgrade the version of postcss-purgecss, but I only saw one of two options to do so. Which version should I be downgrading to in order to drop the postCSS v8 support?

akshatksharma avatar Dec 25 '20 02:12 akshatksharma

I had the same issue I solved it by installing. >npm i -D @fullhuman/[email protected]

Alferdize avatar Feb 03 '21 06:02 Alferdize

Related to https://github.com/FullHuman/purgecss/issues/654

Ffloriel avatar Nov 28 '21 18:11 Ffloriel