LaunchWithDebugging broken in Microsoft.AspNetCore.SpaServices version 1.1.1? #703

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

Originally created by @Maarten88 on 5/30/2017

I am trying to debug server side prerendering, so I added:

services.AddNodeServices(options => {
    options.LaunchWithDebugging = true;
    options.DebuggingPort = 9229;
});

This resulted in an immediate error on the first request going to node:

System.InvalidOperationException: An attempt was made to transition a task to a final state when it had already completed.
   at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at Microsoft.AspNetCore.NodeServices.HostingModels.OutOfProcessNodeInstance.<>c__DisplayClass24_0.<ConnectToInputOutputStreams>b__0(Object sender, DataReceivedEventArgs evt)
   at System.Diagnostics.Process.OutputReadNotifyUser(String data)

This did work before for me. Indeed, downgrading Microsoft.AspNetCore.SpaServices to version 1.1.0 solved the problem, but I'd prefer using the chrome inspector that the 1.1.1 version supports.

I verified this error on a newly generated react-redux aspnetcore-spa solution: just adding options.LaunchWithDebugging = true reproduces the error on my machine.

My node version is 6.10.3

Edit: found #974, maybe that is my problem?

*Originally created by @Maarten88 on 5/30/2017* I am trying to debug server side prerendering, so I added: services.AddNodeServices(options => { options.LaunchWithDebugging = true; options.DebuggingPort = 9229; }); This resulted in an immediate error on the first request going to node: System.InvalidOperationException: An attempt was made to transition a task to a final state when it had already completed. at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) at Microsoft.AspNetCore.NodeServices.HostingModels.OutOfProcessNodeInstance.<>c__DisplayClass24_0.<ConnectToInputOutputStreams>b__0(Object sender, DataReceivedEventArgs evt) at System.Diagnostics.Process.OutputReadNotifyUser(String data) This did work before for me. Indeed, downgrading Microsoft.AspNetCore.SpaServices to version 1.1.0 solved the problem, but I'd prefer using the chrome inspector that the 1.1.1 version supports. I verified this error on a newly generated react-redux aspnetcore-spa solution: just adding options.LaunchWithDebugging = true reproduces the error on my machine. My node version is 6.10.3 Edit: found #974, maybe that is my problem?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#703
No description provided.