Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[!] (plugin postcss) Error: PostCSS plugin autoprefixer requires PostCSS 8. #330

Closed
vaseala opened this issue Oct 27, 2020 · 5 comments
Closed

Comments

@vaseala
Copy link

vaseala commented Oct 27, 2020

It report:
[!] (plugin postcss) Error: PostCSS plugin autoprefixer requires PostCSS 8. when I use autoprefixer@10.0.1

@boguz
Copy link

boguz commented Nov 2, 2020

i am also getting the same error "requires PostCSS 8" error while using:

  • "rollup": "^2.3.4",
  • "postcss-import": "^13.0.0",
  • "rollup-plugin-postcss": "^3.1.8",
  • "rollup-plugin-postcss-lit": "^1.0.1"

And this is the error: [!] (plugin postcss) Error: PostCSS plugin postcss-import requires PostCSS 8.

@isaacl
Copy link

isaacl commented Nov 6, 2020

That's because postcss 7 is listed as a dependency here, when it should be a peerDependency.

And as far as I can tell, this project only supports postcss 7 at the moment.

@eugeneilyin
Copy link

eugeneilyin commented Nov 14, 2020

@egoist, @benmccann, @MichaelAnd, @wardpeet, @JounQin can you fix this peerDependency in the package.json for rollup-plugin-postcss from the suggested fork in #324 and put it into npm? It's very annoying to revert package.json manually to the fixed variant after any yarn command due to npm contains the 3.1.8 version. Thanks :)

{
  "name": "rollup-plugin-postcss",
  "version": "3.1.9",
  "description": "Seamless integration between Rollup and PostCSS",
  "main": "dist/index.js",
  "files": [
    "dist",
    "types/index.d.ts"
  ],
  "scripts": {
    "test": "npm run lint && jest",
    "test:cov": "npm run lint && jest --coverage",
    "build": "bili",
    "lint": "xo",
    "prepublishOnly": "npm run build"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/egoist/rollup-plugin-postcss.git"
  },
  "keywords": [
    "postcss",
    "rollup"
  ],
  "author": "EGOIST <0x142857@gmail.com>",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/egoist/rollup-plugin-postcss/issues"
  },
  "engines": {
    "node": ">=10"
  },
  "types": "./types/index.d.ts",
  "homepage": "https://github.com/egoist/rollup-plugin-postcss#readme",
  "devDependencies": {
    "@babel/core": "^7.9.0",
    "@babel/preset-env": "^7.9.5",
    "autoprefixer": "^10.0.1",
    "babel-core": "^7.0.0-bridge.0",
    "babel-jest": "^26.6.3",
    "bili": "^5.0.5",
    "eslint-config-rem": "^4.0.0",
    "fs-extra": "^9.0.0",
    "jest": "^26.6.3",
    "less": "^3.11.1",
    "node-sass": "^4.13.1",
    "postcss": "^8.1.6",
    "rollup": "^2.6.1",
    "stylus": "^0.54.7",
    "sugarss": "^3.0.3",
    "xo": "^0.29.1"
  },
  "dependencies": {
    "chalk": "^4.0.0",
    "concat-with-sourcemaps": "^1.1.0",
    "cssnano": "^4.1.10",
    "import-cwd": "^3.0.0",
    "p-queue": "^6.3.0",
    "pify": "^5.0.0",
    "postcss-load-config": "^3.0.0",
    "postcss-modules": "^3.2.2",
    "promise.series": "^0.2.0",
    "resolve": "^1.16.1",
    "rollup-pluginutils": "^2.8.2",
    "safe-identifier": "^0.4.1",
    "style-inject": "^0.3.0"
  },
  "peerDependencies": {
    "postcss": "^8.1.6"
  },
  "xo": {
    "extends": "rem",
    "envs": [
      "jest"
    ],
    "rules": {
      "import/prefer-default-export": 0,
      "import/extensions": 0,
      "import/no-unassigned-import": 0,
      "@typescript-eslint/semi": 0,
      "eslint-comments/disable-enable-pair": 0,
      "promise/prefer-await-to-then": 0
    }
  },
  "jest": {
    "testEnvironment": "node"
  },
  "babel": {
    "presets": [
      [
        "@babel/preset-env",
        {
          "targets": {
            "node": "6"
          }
        }
      ]
    ]
  },
  "release": {
    "branches": [
      "master",
      "next"
    ]
  }
}

@SASUKE40
Copy link
Collaborator

SASUKE40 commented Dec 7, 2020

🎉 This issue is resolved in version 4.0.0 🎉

The release is available on:

@SASUKE40 SASUKE40 closed this as completed Dec 7, 2020
@ycg520520
Copy link

最新版本还是会报错具体原因是:cssnano的版本问题,在项目中配置
"peerDependencies": {
"cssnano": "^5.0.3"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants