0

I have upgraded my Angular project from 8 to 10 but while compiling I am getting the following error.

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');

I am not able to find out what is happening here.

can anyone please help me with this?

enter image description here

Thanks in Advance!

Jayesh Vyas
  • 1,145
  • 3
  • 15
  • 35
  • as stated on the github repo of ngx-loading repo, it doesn't support Angular 9/10. About the second issue, you need to add typing. – Gérôme Grignon Aug 24 '20 at 13:29
  • Does this answer your question? [Angular error - Generic type 'ModuleWithProviders' requires 1 type argument(s)](https://stackoverflow.com/questions/62755093/angular-error-generic-type-modulewithproviderst-requires-1-type-arguments) – R. Richards Aug 24 '20 at 14:01

1 Answers1

0

Since Angular 9 ModuleWithProviders needs generic type that refers to the type of the NgModule.

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

The ngx-loading project doesn't implement these changes, yet. But as it seems there is a pull request waiting to be done.

Sören
  • 26
  • 6