Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.stack.imgur.com/e9i18.png
like image 298
Mahendra Kumar Avatar asked Dec 31 '22 23:12

Mahendra Kumar


1 Answers

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.

like image 80
TheGuern Avatar answered Jan 02 '23 12:01

TheGuern