gpt4 book ai didi

angular - MatToolbar 与 Angular 9 一起使用时抛出错误

转载 作者:行者123 更新时间:2023-12-03 07:29:16 25 4
gpt4 key购买 nike

Angular 版本 9.2.0

当我导入 MatToolbarModule在一个模块中并在 html 模板中使用它,然后我收到以下错误消息:

This likely means that the library (@angular/material/toolbar) which declares MatToolbarModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

8 export declare class MatToolbarModule {
~~~~~~~~~~~~~~~~
src/app/angular-material.module.ts:53:14 - error NG6002: Appears in the NgModule.imports of ComponentsModule, but itself has errors


有没有人面临同样的问题?

最佳答案

package.json 中添加以下具体配置和 npm install .

{
"scripts": {
"postinstall": "ngcc"
}
}
引用 : https://angular.io/guide/ivy#speeding-up-ngcc-compilation

关于angular - MatToolbar 与 Angular 9 一起使用时抛出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61079125/

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