Postcss: Unexpected CSS removal in 7.0.19 when using TailwindCSS

Created on 24 Oct 2019  路  11Comments  路  Source: postcss/postcss

Hi!

Dependabot auto-updated postcss for me this morning from 7.0.18 to 7.0.19.

However, my site output for 7.0.19 looks like this:

2019-10-24 at 7 01 AM

With postcss 7.0.18 installed, my site output looks like this:

2019-10-24 at 7 00 AM

It seems like there might be a regression in 7.0.19.

What information can I provide to help debug?

Most helpful comment

Yep our tests are failing on 7.0.19 by the looks of it but not 100% sure why. Going to investigate more deeply in about 15 minutes, currently watching Peppa Pig with my daughter 馃槃

All 11 comments

  1. Try to compare output CSS for one component to find what was changed. Post changes here.
  2. Show your PostCSS plugins.

Here's the original https://gist.github.com/danielbachhuber/047ea044c467a327a33caf94db437e4b/725a0a2e37ace2f7c518b287b86d0ccff64af9a9

Here's the broken: https://gist.github.com/danielbachhuber/047ea044c467a327a33caf94db437e4b/1c613fb25fe97b1ff5c223da1dfc12a650242386

It looks like it's removing ~9k lines of CSS:

image

My PostCSS plugins are:

module.exports = {
  plugins: [require('tailwindcss')('./tailwind.config.js')],
}

@danielbachhuber can you try to show diff output between these two files?

I am trying to reproduce the issue in my project.

can you try to show diff output between these two files?

Yep, here's the diff output: https://gist.github.com/danielbachhuber/047ea044c467a327a33caf94db437e4b#file-style-diff

I checked my plugins and didn鈥檛 found any problem. Tailwindcss uses too many PostCSS plugins and output is too big to help you with this data.

@adamwathan can you help us? Did you see any problems with new PostCSS 7.0.19?

I add fix for code like: rule.append({ selector: 'a', nodes: [decl] }) https://github.com/postcss/postcss/commit/3494ffc2e78635944d1e68169dc1def324d3e371

Maybe, do you use passing nodes to node鈥檚 constructor and the change break something?

Yep our tests are failing on 7.0.19 by the looks of it but not 100% sure why. Going to investigate more deeply in about 15 minutes, currently watching Peppa Pig with my daughter 馃槃

With help by @adamwathan we found the source of the problem. I will try to fix it quickly.

If you're in a jam and need to deploy before it is fixed, this worked for me if you use yarn:

Add this to your package.json:

"resolutions": {
  "postcss": "7.0.18"
}

Fixed 6d6d982. Release is coming.

Fix was released in 7.0.20

Thanks @ai! I appreciate your hard work :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AdeSupriyadi picture AdeSupriyadi  路  3Comments

buhlahkay picture buhlahkay  路  3Comments

StephenEsser picture StephenEsser  路  9Comments

ZeeCoder picture ZeeCoder  路  7Comments

azat-io picture azat-io  路  3Comments