oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
73.01k stars 2.66k forks source link

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

Open TomYeoman opened 8 months ago

TomYeoman commented 8 months ago

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

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

Code2Life commented 7 months ago

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

t1nky commented 7 months ago

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.