angular / angular-cli

CLI tool for Angular
https://cli.angular.io
MIT License
26.74k stars 11.98k forks source link

[v8.0] BrowserslistError: Unknown browser kaios #14557

Closed lacolaco closed 5 years ago

lacolaco commented 5 years ago

🐞 Bug report

Command (mark with an x)

- [ ] new
- [x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [x] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

Yes, the previous version in which this bug was not present was: .... ### Description A clear and concise description of the problem... After `ng update @angular/cli` from Anguar CLI v7.3.6, `ng build` command throws such error. ## πŸ”¬ Minimal Reproduction

I didn't get a repro yet. In my situation, the project has some caniuse-related dependencies;

Diff of yarn.lock is here;

Before

caniuse-lite@^1.0.30000929, caniuse-lite@^1.0.30000947, caniuse-lite@^1.0.30000955:
  version "1.0.30000955"
  resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000955.tgz#360fdb9a1e41d6dd996130411334e44a39e4446d"
  integrity sha512-6AwmIKgqCYfDWWadRkAuZSHMQP4Mmy96xAXEdRBlN/luQhlRYOKgwOlZ9plpCOsVbBuqbTmGqDK3JUM/nlr8CA==

caniuse-lite@^1.0.30000957, caniuse-lite@^1.0.30000960:
  version "1.0.30000962"
  resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000962.tgz#6c10c3ab304b89bea905e66adf98c0905088ee44"
  integrity sha512-WXYsW38HK+6eaj5IZR16Rn91TGhU3OhbwjKZvJ4HN/XBIABLKfbij9Mnd3pM0VEwZSlltWjoWg3I8FQ0DGgNOA==

After ng update

caniuse-lite@^1.0.0:
  version "1.0.30000971"
  resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000971.tgz#d1000e4546486a6977756547352bc96a4cfd2b13"
  integrity sha512-TQFYFhRS0O5rdsmSbF1Wn+16latXYsQJat66f7S7lizXW1PVpWJeZw9wqqVLIjuxDRz7s7xRUj13QCfd8hKn6g==

caniuse-lite@^1.0.30000929, caniuse-lite@^1.0.30000947, caniuse-lite@^1.0.30000955:
  version "1.0.30000955"
  resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000955.tgz#360fdb9a1e41d6dd996130411334e44a39e4446d"
  integrity sha512-6AwmIKgqCYfDWWadRkAuZSHMQP4Mmy96xAXEdRBlN/luQhlRYOKgwOlZ9plpCOsVbBuqbTmGqDK3JUM/nlr8CA==

caniuse-lite@^1.0.30000957, caniuse-lite@^1.0.30000960:
  version "1.0.30000962"
  resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000962.tgz#6c10c3ab304b89bea905e66adf98c0905088ee44"
  integrity sha512-WXYsW38HK+6eaj5IZR16Rn91TGhU3OhbwjKZvJ4HN/XBIABLKfbij9Mnd3pM0VEwZSlltWjoWg3I8FQ0DGgNOA==

πŸ”₯ Exception or Error




$ ng build 
Unknown browser kaios
BrowserslistError: Unknown browser kaios
    at checkName (/Users/laco/Works/xxxxxx/node_modules/browserslist/index.js:171:20)
    at Function.select (/Users/laco/Works/xxxxxx/node_modules/browserslist/index.js:881:18)
    at /Users/laco/Works/xxxxxx/node_modules/browserslist/index.js:215:33
    at Array.reduce ()
    at resolve (/Users/laco/Works/xxxxxx/node_modules/browserslist/index.js:197:18)
    at browserslist (/Users/laco/Works/xxxxxx/node_modules/browserslist/index.js:317:16)
    at Object.isSupported (/Users/laco/Works/xxxxxx/node_modules/caniuse-api/dist/index.js:62:37)
    at isEs5SupportNeeded (/Users/laco/Works/xxxxxx/node_modules/@angular-devkit/build-angular/src/utils/differential-loading.js:22:21)
    at Object.isDifferentialLoadingNeeded (/Users/laco/Works/xxxxxx/node_modules/@angular-devkit/build-angular/src/utils/differential-loading.js:15:29)
    at generateWebpackConfig (/Users/laco/Works/xxxxxx/node_modules/@angular-devkit/build-angular/src/utils/webpack-browser-config.js:25:35)
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at Function.Module.runMain (internal/modules/cjs/loader.js:832:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

🌍 Your Environment




Angular CLI: 8.0.0
Node: 10.16.0
OS: darwin x64
Angular: 8.0.0
... animations, cli, common, compiler, compiler-cli, core
... elements, forms, language-service, platform-browser
... platform-browser-dynamic, router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.800.0
@angular-devkit/build-angular      0.800.0
@angular-devkit/build-ng-packagr   0.800.0
@angular-devkit/build-optimizer    0.800.0
@angular-devkit/build-webpack      0.800.0
@angular-devkit/core               8.0.0
@angular-devkit/schematics         8.0.0
@angular/cdk                       7.3.4
@ngtools/json-schema               1.1.0
@ngtools/webpack                   8.0.0
@schematics/angular                8.0.0
@schematics/update                 0.800.0
ng-packagr                         5.2.0
rxjs                               6.5.2
typescript                         3.4.5
webpack                            4.30.0

Anything else relevant?

This seems the same problem to https://stackoverflow.com/questions/55681358/browserslisterror-unknown-browser-kaios

filipesilva commented 5 years ago

I saw something similar in our setup as well, which I had to fix in https://github.com/angular/angular-cli/pull/14303.

I'm not sure what we can do here. It seems like a dependency problem in browserslist.

lacolaco commented 5 years ago

Simple workaround for yarn is resolutions field in package.json and re-run yarn install --force.

{
  ....
  "resolutions": {
    "caniuse-lite": "1.0.30000971"
  }
}
elvirdolic commented 5 years ago

We have the same issue with upgrade to angular 8 and @angular-devkit/architect 0.800.0

porevishal commented 5 years ago

Same issue encountered while upgrading to v8 from v7. Upgraded node to v12.3.1 from v10.15.3 and running the below upgrade command

ng update @angular/cli @angular/core

Logs below :

ng serve

Unknown browser kaios
BrowserslistError: Unknown browser kaios
    at checkName (D:\fmcts\node_modules\browserslist\index.js:132:20)
    at Function.select (D:\fmcts\node_modules\browserslist\index.js:830:18)
    at D:\fmcts\node_modules\browserslist\index.js:176:33
    at Array.reduce (<anonymous>)
    at resolve (D:\fmcts\node_modules\browserslist\index.js:158:18)
    at browserslist (D:\fmcts\node_modules\browserslist\index.js:278:16)
    at Object.isSupported (D:\fmcts\node_modules\caniuse-api\dist\index.js:62:37)
    at Object.isEs5SupportNeeded (D:\fmcts\node_modules\@angular-devkit\build-angular\src\utils\differential-loading.js:22:21)
    at Object.getCommonConfig (D:\fmcts\node_modules\@angular-devkit\build-angular\src\angular-cli-files\models\webpack-configs\common.js:65:88)
    at D:\fmcts\node_modules\@angular-devkit\build-angular\src\browser\index.js:48:27
    at D:\fmcts\node_modules\@angular-devkit\build-angular\src\utils\webpack-browser-config.js:56:26
    at Array.map (<anonymous>)
    at generateWebpackConfig (D:\fmcts\node_modules\@angular-devkit\build-angular\src\utils\webpack-browser-config.js:31:26)
    at async Object.generateBrowserWebpackConfigFromContext (D:\fmcts\node_modules\@angular-devkit\build-angular\src\utils\webpack-browser-config.js:98:20)
    at async setup (D:\fmcts\node_modules\@angular-devkit\build-angular\src\dev-server\index.js:70:37)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! logy-ui@0.0.0 start: `ng serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the logy-ui@0.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\sartaj\AppData\Roaming\npm-cache\_logs\2019-05-30T04_22_22_135Z-debug.log
tzjoke commented 5 years ago

Is there any workaround for NPM? Node v12.3.1

shprink commented 5 years ago

I had the same problem until I cleaned up a bit:

rm -fr node_modules
rm package-lock.json
npm i 

after that it worked.

tbnovaes commented 5 years ago

doing what @shprink said also solved the problem for me.

porevishal commented 5 years ago

I had the same problem until I cleaned up a bit:

rm -fr node_modules
rm package-lock.json
npm i 

after that it worked.

My bad really...I did not do "npm install" at all after doing an upgrade from v7 to v8 (school boy mistake). I am doing that now but I have other issues to solve...Will post details as soon as I am done.

uvconnects commented 5 years ago

Having same issue all above does not fix it. Unknown browser kaios BrowserslistError: Unknown browser kaios

uvconnects commented 5 years ago

Unknown browser kaios BrowserslistError: Unknown browser kaios at checkName (C:\git\node_modules\browserslist\index.js:171:20) at Function.select (C:\git\node_modules\browserslist\index.js:881:18) at C:\git\node_modules\browserslist\index.js:215:33 at Array.reduce (<anonymous>) at resolve (C:\git\node_modules\browserslist\index.js:197:18) at browserslist (C:\git\node_modules\browserslist\index.js:317:16) at Object.isSupported (C:\git\node_modules\caniuse-api\dist\index.js:62:37) at Object.isEs5SupportNeeded (C:\git\node_modules\@angular-devkit\build-angular\src\utils\differential-loading.js:22:21) at Object.getCommonConfig (C:\git\node_modules\@angular-devkit\build-angular\src\angular-cli-files\models\webpack-configs\common.js:66:92) at C:\git\node_modules\@angular-devkit\build-angular\src\browser\index.js:48:27 at C:\git\node_modules\@angular-devkit\build-angular\src\utils\webpack-browser-config.js:56:26

r-hannuschka commented 5 years ago

@Sevensnake the solution from @shprink worked to for me but i have to clean the cache, have u tried this ?

rm -rf node_modules
rm package-lock.json
# just to be sure
npm cache clean --force 
npm i
alan-agius4 commented 5 years ago

Hi all, is this still reproducible with Angular CLI 8.0.3?

alan-agius4 commented 5 years ago

Thanks for reporting this issue. This issue is now obsolete due to changes in the recent releases. Please update to the most recent Angular CLI version.

If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior.

angular-automatic-lock-bot[bot] commented 5 years ago

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.