Angular error - Generic type 'ModuleWithProviders' requires 1 type argument(s)

前端 未结 7 1214
旧巷少年郎
旧巷少年郎 2020-12-07 01:01

After upgrading from Angular version 8 to 10.

Running the - ng serve command gives me error -

ERROR in node_modules/ngx-tree-select/src/module.d.ts:11:56 - err

7条回答
  •  抹茶落季
    2020-12-07 01:24

    To skip this type error just add in you code:

    declare module "@angular/core" {
        interface ModuleWithProviders {
            ngModule: Type;
            providers?: Provider[];
        }
    }
    

    Note: this will fix the type checking and allow to continue - if you will notice other lib to Angular10 inconmpatibilities - you need to ask lib upgrade or found another one.

提交回复
热议问题