Meteor 1.4 not starting due to debugger statements

In case someone else may have run into this, maybe I can save you some time.

Old Behavior (prior to Meteor 1.4, Node v0.10.46)

Set NODE_OPTIONS=--debug
Sprinkle debugger statements in code
meteor command will start and run fine, skipping debugger statements

New Behavior (Meteor 1.4, Node v4.4.7)

Set NODE_OPTIONS=--debug
Sprinkle debugger statements in code
meteor command will start will stop at first debugger statement waiting for a debugger to attach

Comments:

The old behavior was quite handy because when I did not use the --debug-brk flag the code would blow past debugger statements unless a debugger was attached. Essentially, I left a few debugger statements in the startup code so that when I used --debug-brk I could just hit continue and it would stop before my init code.

The new behavior may be even better, now I can put in debugger statements in the init code when I want to debug there and avoid the use of the --debug-brk flag altogether. --debug-brk is a pain because it would start debugging from the very beginning of the code load. And this would involve loading each package in debug mode which is very slow.

So now debugging my init code will be a much quicker as I can avoid loading all packages in debug mode. Thanks Node v4.4.7!

1 Like

This would be a great addition to the article in the guide about migrating to meteor 1.4!

1 Like

Thanks for the suggestion, it motivated me to figure out how to do it!

1 Like