NodeInvocationException when calling InvokeAsync<string> #94

Closed
opened 2025-08-09 17:14:59 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @soend on 4/18/2018

Im trying to run a script from my .net core 2.1 application. Here is the line how i call it:
var foo = await _nodeServices.InvokeAsync<string>("./Scripts/jsService");

And here's my simple test javascript:

module.exports = function (callback) {
    callback("foobar");
};

But all i get is an exception:
Microsoft.AspNetCore.NodeServices.HostingModels.NodeInvocationException: 'foobar'

I can see my returned string in the exception but why is it giving me this exception when everything seems to be working?

*Originally created by @soend on 4/18/2018* Im trying to run a script from my .net core 2.1 application. Here is the line how i call it: `var foo = await _nodeServices.InvokeAsync<string>("./Scripts/jsService");` And here's my simple test javascript: ``` module.exports = function (callback) { callback("foobar"); }; ``` But all i get is an exception: `Microsoft.AspNetCore.NodeServices.HostingModels.NodeInvocationException: 'foobar'` I can see my returned string in the exception but why is it giving me this exception when everything seems to be working?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#94
No description provided.