bun icon indicating copy to clipboard operation
bun copied to clipboard

Bun can "run", but not "debug" NPM scripts in VSCode

Open TomYeoman opened this issue 1 year ago • 2 comments

What version of Bun is running?

1.0.18+36c316a24

What platform is your computer?

Linux 5.15.133.1-microsoft-standard-WSL2 x86_64 x86_64

What steps can reproduce the bug?

Video illustrates this best -

  1. I show running "dev" command works fine, server is started
  2. I try running the debug, and I get the message
Failed to start debugger.
Program must be a JavaScript or TypeScript file.

https://github.com/oven-sh/bun/assets/14075632/d93349f0-d971-47d9-9beb-adfe90189c2b

I'm using a fresh install of create-t3-app if you want to reproduce my exact setup

  • npm create t3-app@latest > select every option, use prisma as DB > run npx prisma db push

What is the expected behavior?

Bun should start the debug session, it works with node using the following launch.json

  "configurations": [
    {
      "name": "Node run NPM script",
      "type": "node",
      "request": "launch",
      "runtimeArgs": [
        "run-script",
        "dev"
      ],
      "runtimeExecutable": "npm",
      "skipFiles": [
        "<node_internals>/**"
      ],
    }
  ]

What do you see instead?

No response

Additional information

No response

TomYeoman avatar Dec 23 '23 07:12 TomYeoman

The same issue in Mac Orbstack created Ubuntu, can run but can not debug, same output

Code2Life avatar Jan 15 '24 01:01 Code2Life

For me it just opens a JavaScript Debug Terminal and does nothing after that, no errors. Latest version 1.0.25 with latest vscode extension version.

t1nky avatar Jan 22 '24 00:01 t1nky