Ziki
Ziki

Reputation: 1440

node v5.* TypeError: Cannot convert undefined or null to object in debug

I tried to debug my Node.js code and I got a weird error:

‌TypeError: Cannot convert undefined or null to object

But if I try to put some code in if-else or other things it works fine.

I tried to simple my code to be only this:

var a = {
    foo:"something"
};
var b = 5;

When I debug it and setting break-point on var b = 5;, and in the console I try to access a.foo it throws an error:

‌TypeError: Cannot convert undefined or null to object
    at t.evaluate (eval at <anonymous> (c:\projects\main\TestProject\test.js:1:11), <anonymous>:171:45)
    at DebugCommandProcessor.r.processDebugJSONRequest (eval at <anonymous> (c:\projects\main\TestProject\test.js:1:11), <anonymous>:383:15)
    at Object.<anonymous> (c:\projects\main\TestProject\test.js:2:1)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.runMain [as _onTimeout] (module.js:457:10)
    at Timer.listOnTimeout (timers.js:92:15)

I remembered that I was able to debug before couple of weeks(I had Node.js v0.12.*), so I decided to downgrade my Node.js(v5.1.1) until it will work.

So the Node.js version that works is: v4.2.3. All of Node.js v5.* throws the same error.

My environment is:

Many thanks for your help!

Upvotes: 1

Views: 1317

Answers (2)

Ziki
Ziki

Reputation: 1440

According to lena:

Please see WEB-18949 - fix should be available in WebStorm 11.0.2 that is coming soon

The fix will be available in WebStorm 11.0.2.

Also there is a EAP version (Build 143.1183), that fixes that issue and more issues, for those who want to experience.

I tested this build(only the bug with the debugging part in Node.js v5.*).

Link for download is available from here: WebStorm-EAP

Upvotes: 0

lena
lena

Reputation: 93828

Please see WEB-18949 - fix should be available in WebStorm 11.0.2 that is coming soon

Upvotes: 3

Related Questions