Getting Postcss warning without using it

Viewed 5929

I'm getting this Postcss warning:

You did not set any plugins, parser, or stringifier. Right now, PostCSS does nothing. Pick plugins for your case on https://www.postcss.parts/ and use them in postcss.config.js. (repeated 19 times)

But I'm not using it. It's very annoying because, as you can see, the message is repeated several times.

I know why I'm getting the error (I don't have a Postcss config file or any plugins, stringifiers, etc, set) but I don't know why is Postcss installed in first place.

This is my package.json

{
  "name": "vip-english-website",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "dev": "nuxt",
    "build": "nuxt build",
    "start": "nuxt start"
  },
  "engines": {
    "node": "16.x"
  },
  "dependencies": {
    "@dzangolab/vue-accordion": "^1.2.0",
    "@nuxtjs/axios": "^5.13.6",
    "express": "^4.17.1",
    "googleapis": "^91.0.0",
    "vue-carousel": "^0.18.0",
    "vue-check-view": "^0.3.0",
    "vue-gapi": "^2.0.0",
    "vue-js-modal": "^2.0.1",
    "vuelidate": "^0.7.6"
  },
  "devDependencies": {
    "@nuxtjs/google-fonts": "^1.3.0",
    "core-js": "^3.19.1",
    "nuxt": "^2.15.8",
    "nuxt-windicss": "^2.0.12"
  }
}

Do anyone have any idea?

3 Answers

Is been 3 days of troubleshooting this error, finally the solution in the github discussion works for me.

I'm using the following dependencies

"vue": "^2.6.14",
"vue-server-renderer": "^2.6.14",
"vue-template-compiler": "^2.6.14",
"vuelidate": "^0.7.7",
"vuetify": "^2.6.1",
"webpack": "^4.46.0"
"axios": "^0.27.2",
"core-js": "^3.19.3",
"nuxt": "^2.15.8",

Github Issue - Allow to disable "You did not set any plugins, parser, or stringifier. Right now, PostCSS does nothing. Pick plugins for your case on https://www.postcss.parts/ and use them in postcss.config.js

In nuxt.config.js, under the build options, add the following as shown below. That worked for me.

build: {
postcss: null,
}

Hope it helps

PostCSS is a dependency of Nuxt. You can use npm ls {package_name} command in your project directory, to view package dependencies tree.
Issue was fixed in recent PostCSS release: https://github.com/postcss/postcss/issues/1375 , but Nuxt probably will update it only on next big release (v3).

I'm using nuxt 2.15.8 & having the same issue.

The following command & config will supress the warning.

npm i -D @nuxt/postcss8 @nuxtjs/style-resources

In nuxt.config.js, edit/add:

buildModules: [
  '@nuxtjs/style-resources',
  '@nuxt/postcss8',
],

build: {
  postcss: {
    plugins: {
    },
    preset: {
    }
  }
}
Related