angular / in-memory-web-api

The code for this project has moved to the angular/angular repo. This repo is now archived.
MIT License
1.18k stars 231 forks source link

Error after upgrading to Angular 9 - ModuleWithProviders requiring to explicitly specify generic type #250

Closed aparna999 closed 4 years ago

aparna999 commented 4 years ago

Hi,

This error occured after I upgraded my project to Angular version 9 and ran ng build --prod

ERROR in Failed to compile entry-point "name of project' (es2015 as esm2015) due to compilation errors: node_modules/angular-in-memory-web-api/http-client-in-memory-web-api.module.d.ts:29:97 - error NG6005: HttpClientInMemoryWebApiModule.forFeature returns a ModuleWithProviders type without a generic type argument. Please add a generic type argument to the ModuleWithProviders type. If this occurrence is in library code you don't control, please contact the library authors.

29 static forFeature(dbCreator: Type, options?: InMemoryBackendConfigArgs): ModuleWithProviders;

My package.json has the latest version "angular-in-memory-web-api": "^0.9.0"

Looks like the latest version of this library is not compatible with Angular 9 version. Angular suggests that ModuleWithProviders needs a generic type.

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

Can someone fix this and make a release soon?

Thanks, Aparna

aparna999 commented 4 years ago

Looks like there is a PR pending https://github.com/angular/in-memory-web-api/pull/245