When I'm debugging the server of a Meteor 1.6 application using the Node.js built-in debugger, when I try to step over a function call that yields the current fiber, the server goes on running and does not stop on the next line of code. Using Meteor 1.5.2.2 and node-inspector, the server properly stops on the next line. Maybe it's possible to use node-inspector with Meteor 1.6, but this doesn't look promising. So this looks like a significant loss of debugging functionality for server code that (for example) writes to Mongo collections. This may be enough grounds for me to hold off on upgrading to Meteor 1.6.
I imagine the underlying incompatibility between fibers and the Node.js built-in debugger is nothing Meteor-specific, so I was surprised not to find any discussion of the problem in a few web searches.
As requested by the bug template, I'm using the 64-bit Linux version of Meteor; I doubt it matters.
Reproduction:
- Run:
git clone https://github.com/mattmccutchen/meteor-debug-yield-repro
cd meteor-debug-yield-repro
meteor npm install # https://github.com/meteor/meteor/pull/8165 ...
meteor debug
- Open http://localhost:8080/?port=5858 in Google Chrome. You should be on the second
debugger statement (there seems to be a problem with stopping early in server startup).
- Press F10 repeatedly. The debugger should eventually step to
console.log("after"); and stop there.
- Exit the server with Ctrl-C.
- Run:
meteor --release=1.6 --inspect
- Open the Google Chrome-based debugger (about:inspect, "Open dedicated DevTools for Node"). You should be on the first
debugger statement.
- Press "Resume". You should now be on the second
debugger statement.
- Press F10 repeatedly. When you are on
f.wait(); and press F10, the console.log("after"); executes without the debugger first stopping on that line.
When I'm debugging the server of a Meteor 1.6 application using the Node.js built-in debugger, when I try to step over a function call that yields the current fiber, the server goes on running and does not stop on the next line of code. Using Meteor 1.5.2.2 and node-inspector, the server properly stops on the next line. Maybe it's possible to use node-inspector with Meteor 1.6, but this doesn't look promising. So this looks like a significant loss of debugging functionality for server code that (for example) writes to Mongo collections. This may be enough grounds for me to hold off on upgrading to Meteor 1.6.
I imagine the underlying incompatibility between fibers and the Node.js built-in debugger is nothing Meteor-specific, so I was surprised not to find any discussion of the problem in a few web searches.
As requested by the bug template, I'm using the 64-bit Linux version of Meteor; I doubt it matters.
Reproduction:
debuggerstatement (there seems to be a problem with stopping early in server startup).console.log("after");and stop there.meteor --release=1.6 --inspectdebuggerstatement.debuggerstatement.f.wait();and press F10, theconsole.log("after");executes without the debugger first stopping on that line.