browserslist: BrowserslistError: Unknown version 0 of and_chr

Steps to reproduce

  1. browserslist@1.5.2 postcss@5.2.11 webpack@2.2.0
  2. browserslist config in the package.json
...
"browserslist": [
    "> 1% in RU",
    "last 2 versions"
]
...
  1. postcss.config.js is simple
module.exports = {
    plugins: [
        require('postcss-import')(),
        require('autoprefixer')()
    ]
};
  1. NODE_ENV=production webpack --hide-modules --bail throws
ERROR in ./styles/index.css
Module build failed: ModuleBuildError: Module build failed: BrowserslistError: Unknown version 0 of and_chr
    at error (~/{path_to_project}/node_modules/browserslist/index.js:29:11)
    at Function.select (~/{path_to_project}/node_modules/browserslist/index.js:555:21)
    at ~/{path_to_project}/node_modules/browserslist/index.js:180:41
    at Array.forEach (native)
    at browserslist (~/{path_to_project}/node_modules/browserslist/index.js:169:13)
    at isSupported (~/{path_to_project}/node_modules/caniuse-api/dist/index.js:75:10)
    at ~/{path_to_project}/node_modules/postcss-merge-rules/dist/lib/ensureCompatibility.js:87:66
...

PS

  • NODE_ENV != production -> ok
  • not use “> 1% in RU” -> ok
  • use “> 1% in US” -> not ok

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 17 (9 by maintainers)

Most upvoted comments

Technically it was Can I Use mistake. But it is hard to fix it there. So I add hack to Browserslist.

@ben-eb maybe we will fix it in you project. Can I use had version 0 in countries statistics, but 55 in global data.