Throwing 500 internal server error with Angular In Memory Web API

Asked on May 02, 2018
I am using "angular-in-memory-web-api": "^0.6.0".  When I run the application, I am getting 500 internal server error in browser console.
Find the stack trace.

ERROR {…}?body: Object { error: "Object(...) is not a function" }?headers: Object { normalizedNames: Map, lazyUpdate: null, lazyInit: lazyInit() }?status: 500?

statusText: "Internal Server Error"?url: "/api/users"?__proto__: Object { … } core.js:1665:5
defaultErrorLogger webpack-

ErrorHandler.prototype.handleError webpack-internal:///./node_modules/@angular/core/esm5/core.js:1726:9

next webpack-internal:///./node_modules/@angular/core/esm5/core.js:5724:119
EventEmitter.prototype.subscribe/schedulerFn< webpack-

SafeSubscriber.prototype.__tryOrUnsub webpack-

How to fix it?

Replied on May 02, 2018
angular-in-memory-web-api   version 0.6.0 works with RxJS v6

Check your RxJS version in package.json

You can solve your error by using angular-in-memory-web-api   version 0.5.4

Use following command:

npm uninstall angular-in-memory-web-api --save

npm i angular-in-memory-web-api@0.5.4 --save


0.6.0 (2018-03-22)

Migrate to Angular v6 and RxJS v6

Note that this release is pinned to Angular "^6.0.0-rc.0" and RxJS "^6.0.0-beta.1". Will likely update again when they are official.

BREAKING CHANGE This version depends on RxJS v6 and is not backward compatible with earlier RxJS versions.

Replied on May 02, 2018
Thanks for the solution.

Write Answer

©2024 | Privacy Policy | Contact Us