Debugging not working for Meteor 1.2 apps in Webstorm?

I’m currently on meteor 1.2 and webstorm 11 and I don’t do anything special, I just create a meteor run configuration and start the debugger. But package debugging still has its problems.

1 Like

@serkandurusoy: Package debugging does not work in WebStorm v11.0.1 but there is a workaround.

Client side debugging works with breakpoints in the IDE but in order to debug server side code (in packages) you need debugger; statements in the code. It is much better than meteor debug with buggy node-inspector 0.7.4.

There is another release and it seems to work fine now with normal IDE
breakpoints.

@serkandurusoy Are you able to get client-side debugging working with breakpoints with the latest EAP release (WS-143-1183.13)?

For me it doesn’t matter which selection I make in Prefs-> Languages&Frameworks->Javascript->LanguageVersion, breakpoints simply do not work when the ecmascript package is installed. It’ll break on the wrong line and all vars show ‘Internal Error’.

Did you do anything special to get this working?

1 Like

Good catch, I have not tried debugging on an ecmascript enabled project yet.

Although, you might want to try using grigio:babel instead of ecmascript because https://youtrack.jetbrains.com/issue/WEB-16397 claims it has been fixed with the babel transpiler.

Guys, I just updated to version 11.0.2 and all of a sudden not a single of my server side breakpoints is working. I even created a complete new app (via WebStorm) and remove the ecmascript package.

Still, not a single breakpoint works.

Am I the only one?

See here https://bitbucket.org/a4xrbj1/breakpoints for the example. Breakpoints in line 21, 22 and 23 don’t work.

Any help in solving this appreciated, otherwise need to re-install version 11.0.1 (at least some of the breakpoints were working there)

EDIT: I can confirm that the sample project works (it stops at the breakpoints) while 11.0.2 doesn’t. But version 11.0.1 had a bug where it still stopped at a breakpoint where there was no more code (4 lines further than the code exists in that file. Version 11.0.2 at least fixed that bug for me

I’m experiencing the same issues.

Since v11.0.2, no breakpoints work at all.
I’ve downgraded back to v11.0.1 since it supports server side debugging, but not client side debugging as others have mentioned in this post.

I was really hoping that they are going to fix it in the new version, but seems they’re only going backwards with this.

Experiencing the same issue, will update the stackoverflow topic to clarify the situation
Jetbrains tracking issue

I’ve got the following answer from WebStorms Twitter account:

@A4XRBJ1 working on a fix, please follow the issue: https://youtrack.jetbrains.com/issue/WEB-19334
One of the problems is the emoji used in URLs in source maps”

But the issue they pointed to me is for version 1.2 whilst I’m having the problems with version 1.1.0.3

On what versions are you guys, @tcastelli and @roylib ?

1.2.1 for me and yes, same issue i was already following. Seems like the debugger is now pretty useless with Meteor projects

Which makes the whole IDE useless (what else do I need an IDE for if not server side debugging)?

I’ve searched but couldn’t find any alternative for Meteor, does anyone know of another IDE for Meteor? I’m mostly doing server side development so it’s quite essential for me

Well that’s a bit of an exaggeration. Even if debugging isn’t working in WebStorm, it’s still immensely useful to me.

Well, if I take the debugging part away it’s no longer an IDE, it’s just an editor. Quite frankly, there are better editors out there for Meteor, Sublime comes to my mind.

WebStorm is an IDE because it has a sense of projects, associating a group of files and settings together as one. Even without the debugger, it’s still technically an IDE, and still has some great features that I haven’t seen in a standalone editor like Atom or Sublime:

  • allows you to cmd-click on a variable or symbol to jump you to its definition, no matter what file it’s in
  • kickass refactoring and renaming features (one of JetBrains’ signature features)
  • runs Meteor for you, including setting environment variables for that session only (very handy)

Sublime is really no big deal IMO. Atom is far better, as it’s actually updated more than once a year (can’t believe Sublime 3 is still in beta!). Sublime’s developer(s) are also not so great at responding to bugs, and since it’s a closed platform, you can’t contribute fixes.

To me those three features you mentioned aren’t worth it. I’ve only used the last one though so I might be missing something awesome. I still lot’s of things manually, as I said I’m half way through evaluating WebStorm 11 and if there would be an alternative IDE with server side debugging I would be happy to test that against WebStorm.

Not sure what you meant with cmd-click on a variable/symbol, nothing happens when I do that.

Oh wow, you’re missing out on a lot! It’s worth it to go through the docs and some videos maybe.

You can cmd-click (Mac) on, for example, a class in HTML and it will jump you to the definition. Or in JSX, you can cmd-click on <MyThing /> and it will open up and take you to the definition of that React class.

And refactoring is excellent. You can have several spots in your code where you repeat something like myThing.doit() - theOtherThing.something.value, and highlight it, and choose refactor, and then pick either var/let/const and it will make a variable for that expression, assign it, and then replace your expression with that new variable automatically throughout the code block.

Really my only gripe with WebStorm is that it’s written in Java, and so it’s not always the snappiest editor on underpowered machines. It’ll never be as fluid as Sublime which is native code. But in WebStorm I feel like I can navigate around quickly and get stuff done faster.

2 Likes

I used the command-click on my backend JS code. Maybe that feature isn’t working there

Well, I have always enjoyed JetBrains IDEs, so even if the debugger is broken for now (let’s cross fingers for a quick update), I still love many of its features, for me the best things are(some were already commented):

  • scoped search system with previews,
  • refactoring,
  • ctrl+click(well this one is tricky and doesn’t always work)
  • autocompletion and redirects based on meteor packages (you have to import them opening the file packages in .meteor)
  • GIT management !!! :heart:
  • file comparison with local history and branches
  • npm scripts
  • typescript integration

So, if you are not using any of those I highly recommend them for Meteor programming.

P.S regarding that good point of having it run meteor for you, I would not agree completely, there’s a bug when you run meteor inside webstorm (in debug mode) and every time the server is restarted because of a code change, the RAM consumption increases (the amount varies between versions and projects) because it doesn’t free all the previously allocated memory.
So for big projects and after a long time running it, it gets quite unstable and breaks. (This has happened since webstorm 9 on windows and even if they improve the “refresh” on every version, I still notice the problem on v 11)

3 Likes

Annoying, it stopped working some months ago and it started work again after an update. Now after the last update it stopped working again.

JB has released a pre-EAP build (basically a dev build) for fix validation. ES2015 appears to be working now for me:

https://youtrack.jetbrains.com/issue/WEB-18074#comment=27-1256421

1 Like