Mahendra Kumar
Mahendra Kumar

Reputation: 41

An unhandled exception occurred: D:\workspace-angular\demoapp1 contains both .browserslistrc and browserslist

when I serve the angular project the following error occurred.

[An unhandled exception occurred: D:\workspace-angular\demoapp1 contains both .browserslistrc and browserslist See "C:\Users\TTLJSR\AppData\Local\Temp\ng-05qxjF\angular-errors.log" for further details.][1]

    at D:\workspace-angular\demoapp1\node_modules\browserslist\node.js:333:15
    at eachParent (D:\workspace-angular\demoapp1\node_modules\browserslist\node.js:49:18)
    at Object.findConfig (D:\workspace-angular\demoapp1\node_modules\browserslist\node.js:301:20)
    at Function.loadConfig (D:\workspace-angular\demoapp1\node_modules\browserslist\node.js:219:37)
    at browserslist (D:\workspace-angular\demoapp1\node_modules\browserslist\index.js:411:31)
    at new BuildBrowserFeatures (D:\workspace-angular\demoapp1\node_modules\@angular-devkit\build-angular\src\utils\build-browser-features.js:18:34)
    at generateWebpackConfig (D:\workspace-angular\demoapp1\node_modules\@angular-devkit\build-angular\src\utils\webpack-browser-config.js:37:34)
    at async generateBrowserWebpackConfigFromContext (D:\workspace-angular\demoapp1\node_modules\@angular-devkit\build-angular\src\utils\webpack-browser-config.js:138:20)
    at async Object.generateI18nBrowserWebpackConfigFromContext (D:\workspace-angular\demoapp1\node_modules\@angular-devkit\build-angular\src\utils\webpack-browser-config.js:87:20)
    at async setup (D:\workspace-angular\demoapp1\node_modules\@angular-devkit\build-angular\src\dev-server\index.js:76:47) ```


 


  [1]: https://i.sstatic.net/e9i18.png

Upvotes: 4

Views: 9691

Answers (3)

Zia Khan
Zia Khan

Reputation: 425

Simple solution that worked for me => Remove both browserslist error and .browserslistrc files.

re-build and run your app using command ng serve

Upvotes: 3

Re_p1ay
Re_p1ay

Reputation: 333

Notice, that was for Angular Project

You can solve your problem by removing both browserslist error and .browserslistrc files.

re-build and run your app

npm run start or yarn serve for my case

Upvotes: 3

TheGuern
TheGuern

Reputation: 174

Delete the newer file, [browserslistrc]

These two files appear identical. I encountered this when I updated my project to the latest Angular version, then restored the project from a backup location. After deleting the newer file [browserslistrc], this error went away. I think this is what Mahendra Kumar was getting at, too.

Upvotes: 8

Related Questions