首页 > 其他分享 >Angular Generating browser application bundles (phase: setup)...An unhandled exception occurred: we

Angular Generating browser application bundles (phase: setup)...An unhandled exception occurred: we

时间:2023-03-30 17:55:31浏览次数:50  
标签:... Generating setup bundles application webpack angular

 

PS F:\WorkGitHub\angulard3tree> ng serve
⠋ Generating browser application bundles (phase: setup)...An unhandled exception occurred: webpack_1.AngularWebpackPlugin is not a constructor
See "C:\Users\ghosii\AppData\Local\Temp\ng-daZXzA\angular-errors.log" for further details.
⠦ Generating browser application bundles (phase: setup)...

 

chatGPT也没有解决到

如果你的Angular版本是12及以上,但是在编译过程中遇到了 webpack_1.AngularWebpackPlugin is not a constructor 错误,可以尝试以下解决方法:

  1. 升级 @angular-devkit/build-angular 到最新版本。可以运行以下命令更新:

    sql ng update @angular-devkit/build-angular
  2. 确认 tsconfig.json 中的 angularCompilerOptions 选项被正确配置。可以参考以下配置:

    json "angularCompilerOptions": { "enableIvy": true, "tsConfig": "./tsconfig.app.json" }
  3. 检查是否已经安装了 @ngtools/webpack。如果没有安装可以运行以下命令安装:

    sql npm install @ngtools/webpack --save-dev

标签:...,Generating,setup,bundles,application,webpack,angular
From: https://www.cnblogs.com/xiaoruilin/p/17273830.html

相关文章