laverdet / node-fibers

Fiber/coroutine support for v8 and node.
MIT License
3.56k stars 224 forks source link

Unable to debug in IDEs #425

Open mgrybyk opened 4 years ago

mgrybyk commented 4 years ago

Description

I'd like to be able to run Futures in IDE's debug console while app is paused in debugger.

Reproduce

const Future = require('fibers/future')

const task = ms => Future.fromPromise(new Promise(resolve => setTimeout(resolve, ms, ms))).wait()

const flowWrapped = function () {
  console.log(task(10))
}.future()

flowWrapped()

The code above works as expected, however if I put a breakpoint inside flowWrapped function and run task(5) in debug console the execution is aborted, the only thing I see is Canceled in debug console.

image

I've also prepared a repository where you can reproduce the issue https://github.com/mgrybyk/fibers-vscode

Expected Result

I'd like to be able to debug with Fibers! Any help is appreciated

Environment