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.

build throws "PostCSS plugin autoprefixer requires PostCSS 8" (alpha.6 regression)

See original GitHub issue

Version

5.0.0-alpha.6

Reproduction link

https://github.com/cexbrayat/alpha6-postcss8

Environment info

System:
    OS: macOS 11.2.2
    CPU: (8) x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
  Binaries:
    Node: 12.20.1 - ~/.nvm/versions/node/v12.20.1/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 6.14.11 - ~/.nvm/versions/node/v12.20.1/bin/npm
  Browsers:
    Chrome: 89.0.4389.82
    Edge: Not Found
    Firefox: 85.0.2
    Safari: 14.0.3
  npmPackages:
    @vue/cli-overlay:  5.0.0-alpha.6
    @vue/cli-plugin-router:  5.0.0-alpha.6
    @vue/cli-plugin-unit-jest: ~5.0.0-alpha.6 => 5.0.0-alpha.6
    @vue/cli-plugin-vuex:  5.0.0-alpha.6
    @vue/cli-service: ~5.0.0-alpha.6 => 5.0.0-alpha.6
    @vue/cli-shared-utils:  5.0.0-alpha.6
    @vue/compiler-core:  3.0.7
    @vue/compiler-dom:  3.0.7
    @vue/compiler-sfc: ^3.0.4 => 3.0.7
    @vue/compiler-ssr:  3.0.7
    @vue/component-compiler-utils:  3.2.0
    @vue/preload-webpack-plugin:  1.1.2
    @vue/reactivity:  3.0.7
    @vue/runtime-core:  3.0.7
    @vue/runtime-dom:  3.0.7
    @vue/shared:  3.0.7
    @vue/test-utils: ^2.0.0-0 => 2.0.0-rc.3
    @vue/web-component-wrapper:  1.3.0
    jest-serializer-vue:  2.0.2
    typescript: ~4.1.2 => 4.1.5
    vue: ^3.0.4 => 3.0.7
    vue-hot-reload-api:  2.3.4
    vue-jest: ^5.0.0-0 => 5.0.0-alpha.8 (4.0.1)
    vue-loader:  16.1.2 (15.9.6)
    vue-style-loader:  4.1.3
    vue-template-es2015-compiler:  1.9.1
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

Create a new application with v5.0.0-alpha.6 (or use https://github.com/cexbrayat/alpha6-postcss8)

npx @vue/cli@next create alpha6-postcss8 -m npm --inlinePreset '{"useConfigFiles": true,"plugins": {"@vue/cli-plugin-unit-jest": {}},"vueVersion":"3"}'

Then try to build it

What is expected?

The app builds properly

What is actually happening?

ERROR  Failed to compile with 1 error                                                                                              

 error  in ./src/App.vue?vue&type=style&index=0&id=1de185ca&lang=css

Error: PostCSS plugin autoprefixer requires PostCSS 8.
Migration guide for end-users:
https://github.com/postcss/postcss/wiki/PostCSS-8-for-end-users

It looks like postcss v8 is not properly installed

npm list postcss

alpha6-postcss8@0.1.0 /Users/ced-pro/Code/test/vue-cli-tests/alpha6-postcss8
β”œβ”€β”¬ @vue/cli-service@5.0.0-alpha.6
β”‚ β”œβ”€β”¬ @vue/component-compiler-utils@3.2.0
β”‚ β”‚ └── postcss@7.0.35
β”‚ β”œβ”€β”¬ css-loader@5.1.2
β”‚ β”‚ └── UNMET PEER DEPENDENCY postcss@8.2.8
β”‚ β”œβ”€β”¬ cssnano@4.1.10
β”‚ β”‚ β”œβ”€β”¬ cssnano-preset-default@4.0.7
β”‚ β”‚ β”‚ β”œβ”€β”¬ css-declaration-sorter@4.0.1
β”‚ β”‚ β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚ β”‚ β”œβ”€β”¬ cssnano-util-raw-cache@4.0.1
β”‚ β”‚ β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚ β”‚ β”œβ”€β”€ postcss@7.0.35  deduped
β”‚ β”‚ β”‚ β”œβ”€β”¬ postcss-calc@7.0.5
β”‚ β”‚ β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚ β”‚ β”œβ”€β”¬ postcss-colormin@4.0.3
β”‚ β”‚ β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚ β”‚ β”œβ”€β”¬ postcss-convert-values@4.0.1
β”‚ β”‚ β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚ β”‚ β”œβ”€β”¬ postcss-discard-comments@4.0.2
β”‚ β”‚ β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚ β”‚ β”œβ”€β”¬ postcss-discard-duplicates@4.0.2
β”‚ β”‚ β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚ β”‚ β”œβ”€β”¬ postcss-discard-empty@4.0.1
β”‚ β”‚ β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚ β”‚ β”œβ”€β”¬ postcss-discard-overridden@4.0.1
β”‚ β”‚ β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚ β”‚ β”œβ”€β”¬ postcss-merge-longhand@4.0.11
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ postcss@7.0.35  deduped
β”‚ β”‚ β”‚ β”‚ └─┬ stylehacks@4.0.3
β”‚ β”‚ β”‚ β”‚   └── postcss@7.0.35  deduped
β”‚ β”‚ β”‚ β”œβ”€β”¬ postcss-merge-rules@4.0.3
β”‚ β”‚ β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚ β”‚ β”œβ”€β”¬ postcss-minify-font-values@4.0.2
β”‚ β”‚ β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚ β”‚ β”œβ”€β”¬ postcss-minify-gradients@4.0.2
β”‚ β”‚ β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚ β”‚ β”œβ”€β”¬ postcss-minify-params@4.0.2
β”‚ β”‚ β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚ β”‚ β”œβ”€β”¬ postcss-minify-selectors@4.0.2
β”‚ β”‚ β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚ β”‚ β”œβ”€β”¬ postcss-normalize-charset@4.0.1
β”‚ β”‚ β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚ β”‚ β”œβ”€β”¬ postcss-normalize-display-values@4.0.2
β”‚ β”‚ β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚ β”‚ β”œβ”€β”¬ postcss-normalize-positions@4.0.2
β”‚ β”‚ β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚ β”‚ β”œβ”€β”¬ postcss-normalize-repeat-style@4.0.2
β”‚ β”‚ β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚ β”‚ β”œβ”€β”¬ postcss-normalize-string@4.0.2
β”‚ β”‚ β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚ β”‚ β”œβ”€β”¬ postcss-normalize-timing-functions@4.0.2
β”‚ β”‚ β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚ β”‚ β”œβ”€β”¬ postcss-normalize-unicode@4.0.1
β”‚ β”‚ β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚ β”‚ β”œβ”€β”¬ postcss-normalize-url@4.0.1
β”‚ β”‚ β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚ β”‚ β”œβ”€β”¬ postcss-normalize-whitespace@4.0.2
β”‚ β”‚ β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚ β”‚ β”œβ”€β”¬ postcss-ordered-values@4.1.2
β”‚ β”‚ β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚ β”‚ β”œβ”€β”¬ postcss-reduce-initial@4.0.3
β”‚ β”‚ β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚ β”‚ β”œβ”€β”¬ postcss-reduce-transforms@4.0.2
β”‚ β”‚ β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚ β”‚ β”œβ”€β”¬ postcss-svgo@4.0.2
β”‚ β”‚ β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚ β”‚ └─┬ postcss-unique-selectors@4.0.1
β”‚ β”‚ β”‚   └── postcss@7.0.35  deduped
β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ └── UNMET PEER DEPENDENCY postcss@8.2.8
└─┬ @vue/compiler-sfc@3.0.7
  └── UNMET PEER DEPENDENCY postcss@8.2.8

npm ERR! peer dep missing: postcss@^8.1.0, required by autoprefixer@10.2.5
npm ERR! peer dep missing: postcss@^8.1.0, required by icss-utils@5.1.0
npm ERR! peer dep missing: postcss@^8.1.0, required by postcss-modules-extract-imports@3.0.0
npm ERR! peer dep missing: postcss@^8.1.0, required by postcss-modules-local-by-default@4.0.0
npm ERR! peer dep missing: postcss@^8.1.0, required by postcss-modules-scope@3.0.0
npm ERR! peer dep missing: postcss@^8.1.0, required by postcss-modules-values@4.0.0
npm ERR! peer dep missing: postcss@^8.0.0, required by postcss-modules@4.0.0

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
cexbrayatcommented, Mar 15, 2021

@sodatea It looks like, despite the fix, alpha.7 has the same issue with the exact same repro.

npm list poscss gives:

alpha7-postcss8@0.1.0 /Users/ced-pro/Code/test/vue-cli-tests/alpha7-postcss8
β”œβ”€β”¬ @vue/cli-service@5.0.0-alpha.7
β”‚ β”œβ”€β”¬ @vue/component-compiler-utils@3.2.0
β”‚ β”‚ └── postcss@7.0.35
β”‚ β”œβ”€β”¬ css-loader@5.1.2
β”‚ β”‚ └── UNMET PEER DEPENDENCY postcss@8.2.8
β”‚ β”œβ”€β”¬ css-minimizer-webpack-plugin@1.2.0
β”‚ β”‚ └─┬ cssnano@4.1.10
β”‚ β”‚   β”œβ”€β”¬ cssnano-preset-default@4.0.7
β”‚ β”‚   β”‚ β”œβ”€β”¬ css-declaration-sorter@4.0.1
β”‚ β”‚   β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚   β”‚ β”œβ”€β”¬ cssnano-util-raw-cache@4.0.1
β”‚ β”‚   β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚   β”‚ β”œβ”€β”€ postcss@7.0.35  deduped
β”‚ β”‚   β”‚ β”œβ”€β”¬ postcss-calc@7.0.5
β”‚ β”‚   β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚   β”‚ β”œβ”€β”¬ postcss-colormin@4.0.3
β”‚ β”‚   β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚   β”‚ β”œβ”€β”¬ postcss-convert-values@4.0.1
β”‚ β”‚   β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚   β”‚ β”œβ”€β”¬ postcss-discard-comments@4.0.2
β”‚ β”‚   β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚   β”‚ β”œβ”€β”¬ postcss-discard-duplicates@4.0.2
β”‚ β”‚   β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚   β”‚ β”œβ”€β”¬ postcss-discard-empty@4.0.1
β”‚ β”‚   β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚   β”‚ β”œβ”€β”¬ postcss-discard-overridden@4.0.1
β”‚ β”‚   β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚   β”‚ β”œβ”€β”¬ postcss-merge-longhand@4.0.11
β”‚ β”‚   β”‚ β”‚ β”œβ”€β”€ postcss@7.0.35  deduped
β”‚ β”‚   β”‚ β”‚ └─┬ stylehacks@4.0.3
β”‚ β”‚   β”‚ β”‚   └── postcss@7.0.35  deduped
β”‚ β”‚   β”‚ β”œβ”€β”¬ postcss-merge-rules@4.0.3
β”‚ β”‚   β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚   β”‚ β”œβ”€β”¬ postcss-minify-font-values@4.0.2
β”‚ β”‚   β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚   β”‚ β”œβ”€β”¬ postcss-minify-gradients@4.0.2
β”‚ β”‚   β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚   β”‚ β”œβ”€β”¬ postcss-minify-params@4.0.2
β”‚ β”‚   β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚   β”‚ β”œβ”€β”¬ postcss-minify-selectors@4.0.2
β”‚ β”‚   β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚   β”‚ β”œβ”€β”¬ postcss-normalize-charset@4.0.1
β”‚ β”‚   β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚   β”‚ β”œβ”€β”¬ postcss-normalize-display-values@4.0.2
β”‚ β”‚   β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚   β”‚ β”œβ”€β”¬ postcss-normalize-positions@4.0.2
β”‚ β”‚   β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚   β”‚ β”œβ”€β”¬ postcss-normalize-repeat-style@4.0.2
β”‚ β”‚   β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚   β”‚ β”œβ”€β”¬ postcss-normalize-string@4.0.2
β”‚ β”‚   β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚   β”‚ β”œβ”€β”¬ postcss-normalize-timing-functions@4.0.2
β”‚ β”‚   β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚   β”‚ β”œβ”€β”¬ postcss-normalize-unicode@4.0.1
β”‚ β”‚   β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚   β”‚ β”œβ”€β”¬ postcss-normalize-url@4.0.1
β”‚ β”‚   β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚   β”‚ β”œβ”€β”¬ postcss-normalize-whitespace@4.0.2
β”‚ β”‚   β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚   β”‚ β”œβ”€β”¬ postcss-ordered-values@4.1.2
β”‚ β”‚   β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚   β”‚ β”œβ”€β”¬ postcss-reduce-initial@4.0.3
β”‚ β”‚   β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚   β”‚ β”œβ”€β”¬ postcss-reduce-transforms@4.0.2
β”‚ β”‚   β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚   β”‚ β”œβ”€β”¬ postcss-svgo@4.0.2
β”‚ β”‚   β”‚ β”‚ └── postcss@7.0.35  deduped
β”‚ β”‚   β”‚ └─┬ postcss-unique-selectors@4.0.1
β”‚ β”‚   β”‚   └── postcss@7.0.35  deduped
β”‚ β”‚   └── postcss@7.0.35  deduped
β”‚ └── UNMET PEER DEPENDENCY postcss@8.2.8
└─┬ @vue/compiler-sfc@3.0.7
  └── UNMET PEER DEPENDENCY postcss@8.2.8

and npm list cssnano gives:

alpha7-postcss8@0.1.0 /Users/ced-pro/Code/test/vue-cli-tests/alpha7-postcss8
└─┬ @vue/cli-service@5.0.0-alpha.7
  β”œβ”€β”¬ css-minimizer-webpack-plugin@1.2.0
  β”‚ └── cssnano@4.1.10
  └── cssnano@5.0.0-rc.1
1reaction
sodateacommented, Mar 11, 2021

Seems fixable by bumping cssnano version to v5.0.0-rc.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

reactjs - Error: PostCSS plugin autoprefixer requires ...
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 plugin autoprefixer requires PostCSS 8. Update ...
Project was building successfully until after updating autoprefixer package. Code Sample. N/A. Your Environment. Software, Version(s)Β ...
Read more >
Error: PostCSS plugin autoprefixer requires PostCSS 8
Running gulp on clean install of subtheme returns error: Error: PostCSS plugin autoprefixer requires PostCSS 8. Steps to reproduce. 1. Create ...
Read more >
[v2.0.0-alpha.71] Error: PostCSS plugin autoprefixer requires ...
Bug Report. I upgraded our internal documentation site to v2.0.0-alpha.71 (from alpha.69) and started receiving several errors along the lines of:
Read more >
[Solved]-Error: PostCSS plugin autoprefixer requires ...
Coding example for the question Error: PostCSS plugin autoprefixer requires PostCSS 8. Update PostCSS or downgrade this plugin-Reactjs.
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