imagekit-angular icon indicating copy to clipboard operation
imagekit-angular copied to clipboard

Using the sdk on @angular/core 17.0.2 gives a type error

Open ahnv opened this issue 11 months ago • 0 comments

Reported Issue:

Using the SDK on @angular/core 17.0.2 throws the error "ImagekitioAngularModule.forRoot returns a ModuleWithProviders type without a generic type argument. Please add a generic type to the ModuleWithProviders type. If this occurence is in library code you don't control, please contact the library authors."

image image

Issue:

Angular has deprecated "ModuleWithProviders type without a generic"

Please refer to following links for reference associated with this deprecation

  • https://angular.io/guide/deprecations#modulewithproviders-type-without-a-generic
  • https://angular.io/guide/migration-module-with-providers

Solution:

Add ImagekitioAngularModule type argument to ModuleWithProviders in file imagekitio-angular.module.ts

The code should look like

static forRoot(config: ImageKitConfiguration): ModuleWithProviders<ImagekitioAngularModule> {

ahnv avatar Mar 11 '24 07:03 ahnv