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!

0
2 comments
Avatar
Permanently deleted user

Thanks Elena.

0

Please sign in to leave a comment.