0

我已将 Angular 项目从 8 升级到 10,但在编译时出现以下错误。

ERROR in node_modules/ngx-loading/lib/ngx-loading.module.d.ts:4:55 - error TS2314: Generic type 'ModuleWithProviders<T>' requires 1 type argument(s).

4     static forRoot(loadingConfig: INgxLoadingConfig): ModuleWithProviders;
                                                        ~~~~~~~~~~~~~~~~~~~
src/app/export/export.component.ts:83:24 - error TS2351: This expression is not constructable.
  Type 'typeof import("jspdf")' has no construct signatures.

83     const pdfDoc = new jsPDF('l');

我无法找出这里发生了什么。

谁能帮我解决这个问题?

在此处输入图像描述

提前致谢!

4

1 回答 1

0

由于 Angular 9ModuleWithProviders需要泛型类型来引用NgModule.

https://angular.io/guide/migration-module-with-providers

ngx-loading 项目还没有实现这些更改。但似乎有一个拉取请求等待完成。

于 2020-08-24T13:39:46.333 回答