In Webstorm 2018.1.2, I canno longer debug in Chrome

This a nodejs and javascript front end project.  I can run my Javascript Debug config in non-debug mode fine.  When I run that same config in debug mode the front-end launches and I can breakpoint but when my code hits an external api (gapi in this case) the front-end hangs, It makes me think something is no longer configured properly.

I also get this error on the console: cb=gapi.loaded_0:103

I searched but there is nothing specifically about this error.  Again, my app runs fine in chrome making gapi calls and everything else except when I launch chrome using debug from Webstorm.

Thank you. 

Comment actions Permalink

it can be anything... please provide the full error dump (from Chrome dev tools console, for example)

Comment actions Permalink

Here is the Chrome console:

cb=gapi.loaded_0:103 Uncaught Object
(anonymous) @ cb=gapi.loaded_0:103
setTimeout (async)
tp @ cb=gapi.loaded_0:103
(anonymous) @ cb=gapi.loaded_0:114
Ap @ cb=gapi.loaded_0:107
Promise.then (async)
um @ cb=gapi.loaded_0:107
_.Qp @ cb=gapi.loaded_0:107
er @ cb=gapi.loaded_0:113
_.C.fl @ cb=gapi.loaded_0:112
(anonymous) @ cb=gapi.loaded_0:108
authResult @ cb=gapi.loaded_0:230
a.R4.(anonymous function) @ cb=gapi.loaded_0:230
jF.xx @ cb=gapi.loaded_0:229
(anonymous) @ cb=gapi.loaded_0:227
BF.dispatchEvent @ cb=gapi.loaded_0:148
_.k.k8 @ cb=gapi.loaded_0:184
(anonymous) @ cb=gapi.loaded_0:196
setTimeout (async)
Tz @ cb=gapi.loaded_0:196
(anonymous) @ cb=gapi.loaded_0:196
TD @ cb=gapi.loaded_0:151
(anonymous) @ cb=gapi.loaded_0:151
setInterval (async)
PF @ cb=gapi.loaded_0:151 @ cb=gapi.loaded_0:150
rl @ cb=gapi.loaded_0:196
pP @ cb=gapi.loaded_0:234
qY @ cb=gapi.loaded_0:230
(anonymous) @ cb=gapi.loaded_0:231
_.C @ cb=gapi.loaded_0:108
jF.W2 @ cb=gapi.loaded_0:231
Qv.a.(anonymous function) @ cb=gapi.loaded_0:215
initSigninV2 @ google-1.0.0.js:39
(anonymous) @ api.js:10
ba @ api.js:3
b @ api.js:10
Y.r.(anonymous function) @ api.js:10
Y.z.(anonymous function) @ api.js:10
(anonymous) @ cb=gapi.loaded_0:1

Comment actions Permalink

mda... not too verbose:( may have smth to do with credentials/authentication. What web server do you host your app on? Can you provide a project that shows up the issue?

Comment actions Permalink

This is all on localhost.  It's strange - I can launch my javascript config in Webstorm in non-debug mode and the javascript app makes all the gapi calls successfully.  When launched in debug mode it runs fine in debug but gets stuck on that gapi call.  This all used to work fine.  I don't think it was the upgrade to 2018.1.2.  I think I must have made some change when I was trying to create a config that would allow me to debug javascript but with my production nodejs app.  I was experimenting with a Nodejs/Chrome config that Webstorm offers.  I never got too far with that but I kind of coincides with this debugging breaking.

Comment actions Permalink

>This is all on localhost

is it your own server, or Webstorm built-in one?

>I don't think it was the upgrade to 2018.1.2

yes - at least I'm anaware of the recent changes that might affect this...

>I was trying to create a config that would allow me to debug javascript but with my production nodejs app.  I was experimenting with a Nodejs/Chrome config that Webstorm offers.  

please can you elaborate on this? Attach to Nodejs/Chrome run configuration is not supposed to be used for client-side apps debugging, it allows attaching to Node.js server running remotely

Comment actions Permalink

I'm using a Node.js config and I'm pointed to node.exe on my local machine. 

I think the issue is purely a local javascript debugging issue. I'm not sure how node or any other web server might be a factor.  I think it was my misunderstanding regarding how the Nodejs/Chrome config was suppposed to work so I've dropped that.

Comment actions Permalink

>I'm using a Node.js config and I'm pointed to node.exe on my local machine. 

well... I'm confused. What does you application look like? is it a gapi client hosted on your own node.js server? Or? What did you try to debug - client or server?


Comment actions Permalink

It is simply a JS/JQuery front end and a Nodejs server.  I'm trying to debug the JS front end.  When the JS launches one of the first things it does is try to find out if anyone is signed into Google by making the gapi call.  This happens before any Nodejs calls.  This all used to work fine in Chrome in debug mode.  

Comment actions Permalink

OK - so it's hosted on your own web server:)

The only idea i have in mind is that there are some CORS issues when making gapi calls - Webstorms sends additional "x-ijt" header when debugging that can cause problems if the server esponds with access-control-allow-headers... If it's not the case, the problem likely originates in your code - different options used depending on environment, etc. Hard to tell without the project

Comment actions Permalink

I don't see how it can be my code when the same exact code runs fine in non-debug mode. It's something about the debug config that is interfering.  I was just hoping for ideas on that front - that is, what I might take a look at regarding debug settings or params. 

However I can appreciate this is tough without the project. 

Comment actions Permalink

SOLVED:  This is a problem in version 66 of Chrome.  When using the javascript debugger (from Webstorm in this case) the gapi signIn() call closes the popup too fast.  This results in the signIn() failing.  This did not happen when not using the javascript debugger.

The solution is that I dropped back to Chrome version 64 and my gapi calls behave as expected, the popup behaves as expected.  

Google should take a look at this - esp. because gapi is their code!


Please sign in to leave a comment.