Ava: Can't debug with Visual Code 1.47

Created on 16 Jul 2020  路  7Comments  路  Source: avajs/ava

Can't debug with Visual Code 1.47, works fine with 1.46.1

help wanted documentation

Most helpful comment

The issue seems to be coming from Ava's "debug"
@dariovmartine for the time being I've been able to get my debug script to work by updating my launch config

    {
      "type": "node",
      "request": "launch",
      "name": "Ava Debug",
      "skipFiles": ["<node_internals>/**"],
      "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/ava",
      "runtimeArgs": ["--config", "${workspaceFolder}/ava.config.js", "${file}", "--timeout=10m"]
    }

All 7 comments

Do you know if there's anything in that VSCode release that changed and may relate to debugging? I assume you followed our recipe, does anything jump out to you given the changes?

Probably has something to do with this https://youtu.be/l0ZQMa6Xt4k?t=835

The issue seems to be coming from Ava's "debug"
@dariovmartine for the time being I've been able to get my debug script to work by updating my launch config

    {
      "type": "node",
      "request": "launch",
      "name": "Ava Debug",
      "skipFiles": ["<node_internals>/**"],
      "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/ava",
      "runtimeArgs": ["--config", "${workspaceFolder}/ava.config.js", "${file}", "--timeout=10m"]
    }

The issue seems to be coming from Ava's "debug"
@dariovmartine for the time being I've been able to get my debug script to work by updating my launch config

    {
      "type": "node",
      "request": "launch",
      "name": "Ava Debug",
      "skipFiles": ["<node_internals>/**"],
      "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/ava",
      "runtimeArgs": ["--config", "${workspaceFolder}/ava.config.js", "${file}", "--timeout=10m"]
    }

works!! thanks!

with this change in launch config now works.

ava debug is still the preferred way to run AVA in debug mode. It deals with the timeouts and everything. Sounds like we need to update our recipe in light of VSCode's changes, though I'm not sure yet what those are.

I put in a PR here: https://github.com/avajs/ava/pull/2547

In general we no longer need any inspect flag (we work by injecting a "bootloader" via a --require in NODE_OPTIONS), and doing --inspect-brk will pause within the bootloader and prevent vs code from seeing the new program at all. There are workarounds to make a tranditional port-based --inspect-brk work, but this comes at the cost of some functionality.

Was this page helpful?
0 / 5 - 0 ratings