-
Notifications
You must be signed in to change notification settings - Fork 517
NodeServices: Can't pipe result stream from chained success callback #298
Comments
First, thanks for supplying such a clear and straightforward repro project. That makes it so much easier to investigate this! I'm not (yet, at least) inclined to think it would make a difference whether you're doing the piping from inside a callback or not. When you tested the synchronous case, were you still using My suspicion is that you just hit an issue with using So, things you can try: Make sure you're passing back any errors from Node to .NET Your sample app doesn't currently do this. You have this: jsreport.render("<h1>Hello, world!</h1>").then(resp => {
resp.stream.pipe(result.stream);
}); Notice that there's no 'reject' handler on your promise, so if there's an error, this code will never send a response back to .NET, so .NET will eventually time out (saying "task was cancelled"). Add a 'reject' handler like this: jsreport.render("<h1>Hello, world!</h1>").then(resp => {
resp.stream.pipe(result.stream);
}, err => result(err)); Look at the log output to see if there are any more severe errors If Now, because I think this is an issue with using |
Thank you for your elaborate response, you're definitely right, just switched to html-pdf instead and it works perfectly in azure as well! Also thanks for the tip on hooking up the error handler as well. Btw loved your talk in Sydney, can't believe nobody clapped (wtf?), my mind was blown at home, I clapped for myself, awesome work, keep it up! |
Hi @ajtowf . I would be interested to know how you incorporated |
Can't seem to pipe to result stream from success callback:
Invoking the callback immediately like below works just fine.
Works fine locally, when deployed to azure we get TaskCancellationException.
Example project to reproduce https://github.com/ajtowf/nodeservices/
Live example with full stacktrace https://nodeservices.azurewebsites.net/
Am I missing something obvious here?
The text was updated successfully, but these errors were encountered: