Open ayjee opened 2 years ago
same for me, any suggestion? 😕
I have the same issue
Can you provide minimal reproducible test case?
@niksy I tried to post that in my original comment. Is there something else you would like to see?
@ayjee we need whole directory and package structure so we’re sure there isn’t any conflicting dependencies and things like that.
@niksy are there any known conflicting dependencies? I'm having the same issue as well.
Can you provide minimal reproducible test case?
Of course.
"devDependencies": { "eslint": "^7.11.0", "eslint-plugin-react": "^7.26.1", "lint-staged": "^11.2.6", "prettier": "^2.4.1", "stylelint": "^14.0.1", "stylelint-config-standard-scss": "^2.0.1" },
"dependencies": { "@testing-library/jest-dom": "^5.15.0", "@testing-library/react": "^11.2.7", "@testing-library/user-event": "^12.8.3", "clsx": "^1.1.1", "node-sass": "^6.0.1", "normalize-scss": "^7.0.1", "prop-types": "^15.7.2", "react": "^17.0.2", "react-dom": "^17.0.2", "react-router-dom": "^5.3.0", "react-scripts": "4.0.3", "web-vitals": "^1.1.2" },
{ "extends": "stylelint-config-standard-scss" }
That's all, to be true. I was impressed, because it is the most standard setup I can imagine. I was thinking about node-sass
package. Maybe it is too new or something
This is related to how npm installs and flattens dependencies. postcss-scss
expects postcss
as peer dependancy, and since you didn’t install it yourself, and most of other dependencies use postcss@7
, that version is placed at root of node_modules
, but our postcss-scss
needs postcss@8
.
Here are possible fixes:
postcss@8
as your project dependancy so postcss-scss
can pick that as top-level postcss
postcss@7
to versions where postcss@8
is expectedThis seems to fix it for me @niksy. Thanks so much!
@niksy Thank you
yarn add -D postcss@8
did the trick
@niksy Thank you. You saved me so much time!
@niksy thanks for this -- I encountered this while upgrading stylelint and the error message is supremely non-obvious!
Slight variation in my situation: bit monorepo, and there are various dependencies at various levels some of which pull in postcss v7 and some v8, and lerna was hosting the v7 as chance would have it. Adding postcss@8 to the top-level package.json resolves. Many thanks.
@niksy Thank you
yarn add -D postcss@8
did the trick
I am using Nuxt 2 and Webpack This works for me. however when i add postcss i got a dozen warnings of:
To fix this:
add the following to your nuxt.conf.js
:
build: {
postcss: null
}
Thank you so much. I take all night to resolve this problem。 thanks! QAQ
I am upgrading to stylelint v14, and moving from
stylelint-config-standard
tostylelint-config-standard-scss
. When I attempt to run stylelint I get the following error, which I can only reproduce withstylelint-config-standard-scss
:Any idea as to what might be causing this issue? Here is my config file: