Base solution for your next web application
Open Closed

Error on angular production build #8825


User avatar
0
lighthousehq created

Hi,

I'm getting the following error message in the console when the api returns an error.

"You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable" and the error block does not get invoked.

This happens only in production build and is working perfectly in development build.

The following is the code in the service proxy

return this.http.request("get", url_, options_).pipe(observableMergeMap((response : any) => { return this.processGetUserAccountsToLink(response_); })).pipe(observableCatch((response: any) => { console.log("error",response_);

The console.log statement is not getting invoked.

The following is the response from the api.

{ "result": null, "targetUrl": null, "success": false, "error": { "code": 404, "message": "No client found with the supplied reference: qwerty", "details": null, "validationErrors": null }, "unAuthorizedRequest": false, "__abp": true }


1 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Do you directly use http or is this code taken from service-proxies.ts ? If so, could you share your code which uses generated proxy service ?