loopback-next icon indicating copy to clipboard operation
loopback-next copied to clipboard

loopback-next unable to send object in reposnse

Open siddhipai opened this issue 9 years ago • 4 comments

when I try to return an object I always get the following error on the console, and no response is returned,

screen shot 2017-04-05 at 4 23 53 pm

loopback-next seems to work only for string data type in response

(node:20186) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: First argument must be a string or Buffer
(node:20186) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

siddhipai avatar Apr 05 '17 23:04 siddhipai

@bajtos I believe this is the reason why we JSON.stringify the response in the initial router correct? Do you have a story to work on this for the current sprint? @deepakrkris @mpatsute @siddhipai need it for part of their loopback-example-facade to loobpack-next port.

superkhau avatar Apr 05 '17 23:04 superkhau

Link to the code?

ritch avatar Apr 06 '17 01:04 ritch

https://github.com/strongloop/loopback-next/blob/master/packages/example-codehub/src/controllers/HealthController.ts#L16

superkhau avatar Apr 06 '17 02:04 superkhau

This will be fixed by https://github.com/strongloop/loopback-next/pull/106

bajtos avatar Apr 06 '17 07:04 bajtos