gpt4 book ai didi

javascript - Angular ng serve 产生错误 : NGCC failed

转载 作者:行者123 更新时间:2023-12-03 07:01:24 38 4
gpt4 key购买 nike

运行后ng serve我在终端窗口中有一个异常:

编译 @angular/core : 模块为 esm5

Error: Error on worker #1: TypeError: Cannot read property 'map' of undefined

和下面的消息:
An unhandled exception occurred: NGCC failed.

/tmp/ng-EAdxWj/angular-errors.log了解更多详情。

Angular 错误.log:
[error] Error: NGCC failed.
at NgccProcessor.process (/IdeaProjects/app/frontend/node_modules/@ngtools/webpack/src/ngcc_processor.js:76:19)
at /IdeaProjects/app/frontend/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:579:31
at SyncHook.eval [as call] (eval at create (/IdeaProjects/app/frontend/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:7:1)
at SyncHook.lazyCompileHook (/IdeaProjects/app/frontend/node_modules/tapable/lib/Hook.js:154:20)
at Object.webpack [as webpackFactory] (/IdeaProjects/app/frontend/node_modules/webpack/lib/webpack.js:55:30)
at createWebpack (/IdeaProjects/app/frontend/node_modules/@angular-devkit/build-webpack/src/webpack-dev-server/index.js:20:36)
at Object.runWebpackDevServer (/IdeaProjects/app/frontend/node_modules/@angular-devkit/build-webpack/src/webpack-dev-server/index.js:46:12)
at SwitchMapSubscriber.project (/IdeaProjects/app/frontend/node_modules/@angular-devkit/build-angular/src/dev-server/index.js:191:32)
at SwitchMapSubscriber._next (/IdeaProjects/app/frontend/node_modules/@angular-devkit/build-angular/node_modules/rxjs/internal/operators/switchMap.js:49:27)
at SwitchMapSubscriber.Subscriber.next (/IdeaProjects/app/frontend/node_modules/@angular-devkit/build-angular/node_modules/rxjs/internal/Subscriber.js:66:18)
at /IdeaProjects/app/frontend/node_modules/@angular-devkit/build-angular/node_modules/rxjs/internal/util/subscribeToPromise.js:7:24
at processTicksAndRejections (internal/process/task_queues.js:97:5)

最佳答案

只是有同样的问题。

通过将以下内容添加到 tsconfig.app.json 来修复它:

"angularCompilerOptions": {
"enableIvy": false
},

希望这可以帮助

关于javascript - Angular ng serve 产生错误 : NGCC failed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61769665/

38 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com