imagekit-angular
imagekit-angular copied to clipboard
Using the sdk on @angular/core 17.0.2 gives a type error
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."
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> {