Skip to content

Is it possible to debug with Bun's inspect? #98

Description

I have a VS Code launch file.

.vscode/launch.json:

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "chrome",
      "request": "launch",
      "name": "client: chrome",
      "url": "http://localhost:3000",
      "webRoot": "${workspaceFolder}"
    },
    {
      "type": "node",
      "request": "launch",
      "name": "server: pylon (bun)",
      "runtimeExecutable": "bun",
      "runtimeArgs": ["--inspect=9229"],
      "cwd": "${workspaceFolder}",
      "args": [".pylon/index.js"],
      "env": {
        "PORT": "3000"
      },
      "outputCapture": "std",
      "console": "integratedTerminal"
    }
  ],
  "compounds": [
    {
      "name": "fullstack: pylon",
      "configurations": ["server: pylon (bun)", "client: chrome"]
    }
  ]
}

When I run "server: pylon (bun)" the terminal provides an inspect URL to open in the browser, but when you load it there are no source files. I appreciate it is just using the one file .pylon/index.js, but that one file doesn't load in the devtools.

The same occurs without the launch.json (bun --inspect run .pylon/index.js).

The app itself loads fine.

Is there a way to debug the app?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions