Debug.js debugger (with Webstorm)


#1

Since updating Webstorm to 2017.3 and also Meteor to 1.6 I am getting an annoying new feature of debug.js being written to .meteor/local/build/programs/server/debug.js.

It contains the followiing:

exports.pause = function () {
  // The debugger pauses here when you run `meteor debug`, so that you can
  // set breakpoints or add `debugger` statements to your server code
  // before the code begins executing. Once you have set any breakpoints
  // you wish to set, click the |▶ button to continue.
  debugger;
};

It means that every time I save any changes to the code the debugger triggers and I have to press the |▶ button to continue.

My guess is that it is something Webstorm is doing, but can anyone confirm? Can it be turned off?


#2

I’m afraid that’s because webstorm is starting the meteor process with --inspect-brk=PORT instead of --inspect alone. Not sure if that’s something that users can configure anywhere.

An alternative is to launch it in “Run” mode but with --inspect and do the debugging with chrome dev tools (which is far from ideals since i prefer to debug in webstorm directly).

Also, at least for me, this new debugger of Node 8 works worse than the old node-inspector, since sometimes it skips lines or omits breakpoints after async calls. Hopefully it gets better with next version.


#3

Thank you. I have added a comment to the jetbrains issue for meteor debugging:

https://youtrack.jetbrains.com/issue/WEB-28311

Hopefully they will re-open the issue and make the change.


#4

The additional comment appears to have been ignored. So instead I have created a new issue. Can anyone who is affected by the issue please vote.

https://youtrack.jetbrains.com/issue/WEB-30124


#5

The fix is mentioned in the comments of the issue: add --inspect as program argument, see https://youtrack.jetbrains.com/issue/WEB-30124#comment=27-2666519


#6

But --inspect is something else. That piece of code is annoying as ****, but is it Jetbrains that’s responsible for it? I think Meteor puts it there and IMO it shouldn’t. IntelliJ and Webstprm behave exactly as the file description say it should.