Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Error in NodeServices using node-inspector #506

Closed
Mystikweb opened this issue Dec 12, 2016 · 1 comment
Closed

Error in NodeServices using node-inspector #506

Mystikweb opened this issue Dec 12, 2016 · 1 comment

Comments

@Mystikweb
Copy link

I am trying to debug the the server side code using node-inspector (0.12.8) and the latest version of the template (0.71) the NodeServices debugger enabled as per the documentation I am receiving the following error:

image

I am running this on a Windows 10 x64 machine with VS2015 with all of the latest updates and tools. Just wondering if I am missing something or possibly an issue with the node-inspector.

@SteveSandersonMS
Copy link
Member

I was getting a slightly different error message, but I think the same underlying problem, when I tried to repro this. If you have Webpack dev middleware enabled, then it caused problems with debug mode, because when the app first starts up, it often writes an updated main-server.js bundle to disk, which causes the Node process to restart. Then, because connection draining is enabled by default, the new Node instance fails to start, because the old one is still temporarily alive and is holding the debugging port open.

You could verify that this is the underlying issue simply by commenting out your EnableWebpackDevMiddleware calls in Startup.js. If that makes the problem with the debugger go away, it's the same issue.

I've now implemented a fix that will be included in the 1.1.0-rc2-final release. Whenever a debug listener is enabled, we bypass connection draining. There's no real disadvantage to doing this, because if you're actively debugging your app, you probably don't mind that requests in other browser tabs could get terminated abruptly when you change source files. It obviously doesn't affect any production scenario, since you would never launch Node with a debugging listener in production.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants