Debugging javascript promises with the JetBrains Chrome Extension
Hi everyone,
I'm using the fetch API and I'm trying to debug a JavaScript Promise. I set the breakpoint on the block when the promise is resolved but it seems like it always just skips to the end of the fetch method call (guessing because it's asynchronous). Is there any way to do this or is this not supported? For instance, here is my fetch call:
fetch('/api/retrieve-all-etfs', {
credentials: 'same-origin',
method: 'POST'
}).then (response => response.json()).then(j => {
console.log(j)
});
But the line with
console.log(j)
Is never broke. It just skips to the end of the statement and breaks there with 'response' undefined.
Thanks!
Please sign in to leave a comment.
Did you try enabling async debugging? see https://blog.jetbrains.com/webstorm/2016/01/webstorm-12-144-2925/
Thanks Elena.