angular-2-local-storage icon indicating copy to clipboard operation
angular-2-local-storage copied to clipboard

Angular 10 build problem

Open medbz opened this issue 4 years ago • 4 comments

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; 

medbz avatar Sep 11 '20 15:09 medbz

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).

Paradox7208 avatar Nov 11 '20 08:11 Paradox7208

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 avatar Jan 18 '21 15:01 surajpravindeshmukh

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?

surajpravindeshmukh avatar Jan 18 '21 15:01 surajpravindeshmukh

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

Eugeny avatar Oct 29 '21 12:10 Eugeny