BrowserslistError: Unknown browser kaios

I was facing the same issue and by fixing the version of caniuse-lite in the package.json with the previous to the last version I was able to workaround the issue.

Append to the package.json

  "resolutions": {
    "caniuse-lite": "1.0.30000957"
  },

Run $ yarn

And check that the yarn.lock is using the expected version:

...
[email protected], caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000939, caniuse-lite@^1.0.30000955, caniuse-lite@^1.0.30000957:
  version "1.0.30000957"
  resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000957.tgz#fb1026bf184d7d62c685205358c3b24b9e29f7b3"
  integrity sha512-8wxNrjAzyiHcLXN/iunskqQnJquQQ6VX8JHfW5kLgAPRSiSuKZiNfmIkP5j7jgyXqAQBSoXyJxfnbCFS0ThSiQ==
...

TL;DR rm yarn.lock; yarn

The long prose:

Both browserslist and postcss-preset-env might be 2nd level (deep) dependencies. This is quite common with create-react-app. However, yarn upgrade does not upgrade locked sub-dependencies and a command to do that is against philosophy of yarn.

Arguably, one of these libraries should restrict required dependency version, and leave it to yarn to resolve good version. If that's the case, then yarn is correct.

It may be possible to resolve this by making some of {browserslist, caniuse-lite, postcss-preset-env} direct [dev] dependencies of your project.

Or, shorter, rm yarn.lock; yarn

References:

  • https://github.com/yarnpkg/yarn/issues/4986
  • https://github.com/browserslist/browserslist/issues/365
  • https://github.com/postcss/autoprefixer/issues/1184