question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PostCSS / Autoprefixer versions are currently throwing errors

See original GitHub issue

It looks like there are some issues with the combination of the most recent versions of PostCSS and Autoprefixer. New Redwood projects install PostCSS 7, and the instructions for installing Tailwind result in the newest version of Autoprefixer being installed (currently v10). There’s a compatibility issue between these versions.

The current recommendation seems to be install Autoprefixer v9. This fixed the error for me. (It was throwing Error: true is not a PostCSS plugin).

There’s a relevant issue here.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
dthyressoncommented, Dec 18, 2020

@jangxyz @thedavidprice and @jtoar

I realized what the issue is:

Need to use:

"tailwindcss": "npm:@tailwindcss/postcss7-compat"

as noted in https://community.redwoodjs.com/t/upgrading-to-tailwindcss-v2/1472.

@jangxyz If you switch your web package.json to:

  "devDependencies": {
    "autoprefixer": "9.8.6",
    "postcss-loader": "4.0.2",
    "tailwindcss": "npm:@tailwindcss/postcss7-compat"
  }

and yarn … it should work again.

And it looks like @jtoar already fixed this in the next release:

https://github.com/redwoodjs/redwood/commits/main/packages/cli/src/commands/setup/tailwind/tailwind.js

I think we can keep this issue closed and direct people to the forum post until the next release.

1reaction
dthyressoncommented, Dec 18, 2020

maybe some major change with v2 in tailwind?

Hi @jangxyz

I’ll try to reproduce with a fresh install of create redwood app and yarn rw setup tailwind and see what might be happening.

Here is a community post with some info on the upgrade from v1 to v2 for existing RWJS projects – and how to use TailwindUI as well:

https://community.redwoodjs.com/t/upgrading-to-tailwindcss-v2/1472/8

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: PostCSS plugin autoprefixer requires ... - Stack Overflow
PostCSS was updated to version 8, however, PostCSS CLI has not yet been updated to handle PostCSS plugins which use the new PostCSS...
Read more >
postcss | Yarn - Package Manager
PostCSS is a tool for transforming styles with JS plugins. These plugins can lint your CSS, support variables and mixins, transpile future CSS...
Read more >
autoprefixer - npm
Parse CSS and add vendor prefixes to CSS rules using values from the Can I Use website. Latest version: 10.4.13, last published: 2...
Read more >
Upgrade Guide - Tailwind CSS
Upgrading your Tailwind CSS projects from v2 to v3.
Read more >
PostCSS Plugin Guidelines
The prefix postcss- shows that the plugin is part of the PostCSS ecosystem. ... You should test in (at least) Node.js active LTS...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found