MoOx / postcss-cssnext

`postcss-cssnext` has been deprecated in favor of `postcss-preset-env`.
https://moox.io/blog/deprecating-cssnext/
MIT License
5.3k stars 188 forks source link

Module build failed: BrowserslistError: Unknown browser major #454

Closed stomvi closed 6 years ago

stomvi commented 6 years ago

I am using nuxt-community express-template with bootstrap@4.0.0. I updated the nuxt version of the express-template to nuxt 1.4.0 which depends on postcss-cssnext@3.1.0. Somehow autoprefixer@^7.1.1 that the latest postcss-cssnext is using may have a bug with browserslist@^2.2.2. They does not support one of the query defined in the browserslist of bootstrap:

last 1 major version

An error occurs during nuxt build:

Module build failed: BrowserslistError: Unknown browser major

Remove the last 1 major version from package.json of bootstrap works. Update the autoprefixer in postcss-cssnext to the latest version also works. I guess the problem is between the autoprefixer and browserslist that the later one does not recognize the query.

autoprefixer has to be updated to the newer version to make this work.

stomvi commented 6 years ago

For now, I just modify the yarn.lock file to force postcss-cssnext to use autoprefixer@8.2.0. If you are using npm, you can use shrinkwrap.

jonathantneal commented 6 years ago

Possibly resolved by #445

MoOx commented 6 years ago

postcss-cssnext has been deprecated in favor of postcss-preset-env. Read more at https://moox.io/blog/deprecating-cssnext/