一个项目从 angular 15 升级至 angular 17 后遇到的问题,请问如何解决?
...
at _ZoneDelegate.invoke (node_modules/zone.js/fesm2015/zone.js:368:26)
at Object.onInvoke (../../packages/core/src/zone/ng_zone.ts:440:29)
at _ZoneDelegate.invoke (node_modules/zone.js/fesm2015/zone.js:367:52)
at Zone.run (node_modules/zone.js/fesm2015/zone.js:130:43)
at node_modules/zone.js/fesm2015/zone.js:1260:36
at _ZoneDelegate.invokeTask (node_modules/zone.js/fesm2015/zone.js:403:31)
at AsyncStackTaggingZoneSpec.onInvokeTask (../../packages/core/src/zone/async-stack-tagging.ts:46:22)
at _ZoneDelegate.invokeTask (node_modules/zone.js/fesm2015/zone.js:402:36)
at Object.onInvokeTask (../../packages/core/src/zone/ng_zone.ts:425:29)
at _ZoneDelegate.invokeTask (node_modules/zone.js/fesm2015/zone.js:402:36)
at Zone.runTask (node_modules/zone.js/fesm2015/zone.js:174:47)
at drainMicroTaskQueue (node_modules/zone.js/fesm2015/zone.js:582:35)
在 https://github.com/angular/angular/issues/45379 的评论中找到了解决方法
Likely you are using
BrowserAnimationsModule
instead ofNoopAnimationsModule
in your unit tests.
在测试中用 NoopAnimationsModule
替换 BrowserAnimationsModule