Webstorm Debug Shows Object as Undefined But Same Object shows Graph in Console

Why when I put a breakpoint in Webstorm on the console.log below is it saying it's undefined yet if I run this code without debug, the console prints out the object graph for expected?


Console:

Here's a video of the problem to support the above http://bit.ly/1V4zYtb

 

Related, here's just another example of weirdness.

if I observe the store object.  For example the line below where I'm setting the store with an array with one JSON object, I know that store has data, because this tests is passing, and if I console.log out that store object, I see that it's got an array after I set that:

    it('should go to Company Detail Page when company is clicked', () => {
store.push([{id: 1, name: 'Company Name'}]);

var component = renderIntoDocument(<App store={store}/>),
expected = find(component, '.ft-company');

console.log("store.value(): ");
console.log(store.value());
expect(expected.length).to.equal(1);
});
});

but in Webstorm when I put a breakpoint on the console.log to take a look at the store, here's what happens:

 

 

 

17 comments

delete this (why no delete button?)

0

would you like to delete your initial post?

0

no  want to delete the comment under my initial post.  Keep the main post up.

0

this is the weirdest thing ever...I just don't get why half the objects would be resolving (like store) and others not (like expected).

0

ok this is really f'd up.  Watch this video now.  I got it working but it's the weirdest thing ever, and it may not work again at any point so it's not a resolution.  I'm not satisfied with what Webstorm is doing nor why it's doing this: https://youtu.be/RzvBrNBoiyk

Have you seen something so weird before in WebStorm?  I don't get it.  Watch the entire vid.  Notice how I just change lines of comments or empty lines and based on the apparent combo of comments and empty lines, debugging works or doesn't work as in I get a value for my expected and component variables or don't when I remove lines ...so bizarre.

 

0

Can you provide a sample project that shows up the issue?

0

resolved, I had forgotten to add the preset

In my mocha debug config in Webstorm, I now have 

js:babel-core/register --presets es2015

previously I just had js:babel-core/register

0

Here's another screencast showing the weird issue. I want to get to the bottom of this or else I can't use Webstorm debug to its fullest nor can I have confidence to recommend Webstorm for JS deveopment in this case.

https://youtu.be/mpZGICZn8EI

also https://youtu.be/RyjusnjJ-iA 

at the end I sorta go through my project and show you the files, code, etc. so you can get a sense of what I'm coding and doing.

0

I'm going to expose my code very briefly if you wanna pull it to try it out.  So clone it now, I'm gonna keep it up for a couple hours.  https://github.com/dschinkel/we-do-tdd

0

Please watch these two as well: https://youtu.be/tLR9wNb2LYg & https://youtu.be/1KiBVgNRyps.  Notice that based on adding or removing line returns, it skips or doesn't skip my expect statement.  If I add too many lines, it skips my expect breakpoint and goes right to my done breakpoint.  If I remove some lines, it'll at some point when I remove enough lines hit my expect breakpoint like it should be doing.

0

I've cloned your repository, thanks! Looking at it now

0

Thanks, reproduced, I've added the corresponding note to youtrack ticket

0

Thanks, you're awesome as usual Elena, appreciate the help.

0

I have the same problem (with or without mocha). When I put a breakpoint it shows me strange errors or 'undefined' for simple objects. When I change code a little bit sometimes it shows object correctly. Both mouse hover, bottom panel and evaluate tool give incorrect results. 

When I try with Chrome Debugger it works correctly.

0

ok this is not resolved, I lied.  problem came up again! errrrrrrr

-1

Please sign in to leave a comment.