phenomnomnominal / angular-2-local-storage

LocalStorageService for Angular 2 with the same API as angular-local-storage
MIT License
93 stars 49 forks source link

Angular 10 build problem #74

Open medbz opened 4 years ago

medbz commented 4 years ago

Hello , we are currently facing this problem when trying to ng build --prod , any solution for this?

ERROR in node_modules/angular-2-local-storage/local-storage.module.d.ts:4:62 - error TS2314: Generic type 'ModuleWithProviders<T>' requires 1 type argument(s).
 4     static forRoot(userConfig?: ILocalStorageServiceConfig): ModuleWithProviders; 
Paradox7208 commented 4 years ago

I have a workaround for this until a fix is added to the package. You can edit the module.d.ts file yourself in node_modules/angular-2-local-storage/local-storage.module.d.ts

static forRoot(userConfig?: ILocalStorageServiceConfig): ModuleWithProviders<LocalStorageModule>;

You simply just need to provide the module as the generic type parameter (line 5 for me).

surajpravindeshmukh commented 3 years ago

I have a workaround for this until a fix is added to the package. You can edit the module.d.ts file yourself in node_modules/angular-2-local-storage/local-storage.module.d.ts

static forRoot(userConfig?: ILocalStorageServiceConfig): ModuleWithProviders<LocalStorageModule>;

You simply just need to provide the module as the generic type parameter (line 5 for me).

I too did the same but it doesn't work while deploying on an instance.

surajpravindeshmukh commented 3 years ago

Hello , we are currently facing this problem when trying to ng build --prod , any solution for this?

ERROR in node_modules/angular-2-local-storage/local-storage.module.d.ts:4:62 - error TS2314: Generic type 'ModuleWithProviders<T>' requires 1 type argument(s).
 4     static forRoot(userConfig?: ILocalStorageServiceConfig): ModuleWithProviders; 

Any luck on finding the solution for this issue?

Eugeny commented 3 years ago

https://www.npmjs.com/package/patch-package