microsoft / microsoft/vscode-js-debug

Webview debug breakpoints not binding to the source file

Open
#2,287 3 comments 0 reactions 1 assignee View on GitHub

@connor4312 is already working on this.

Since Oct 22, 2025.

bug
Dominant language
TypeScript
Stars
2k
Forks
373
Avg merge
1d 9m
Merged PRs (30d)
6

Description

Describe the bug
A clear and concise description of what the bug is.
I'm trying to debug my extension webview (react + webpack). Breakpoints are popping up the .js file instead of the actual source file.

Launch config

{
    "name": "WI Extension",
    "type": "extensionHost",
    "request": "launch",
    "env": {
        "WEB_VIEW_DEV_MODE": "true",
        "WEB_VIEW_DEV_HOST": "http://localhost:3000",
    },
    "debugWebviews": true,
    "args": [
        "--extensionDevelopmentPath=${workspaceFolder}/workspaces/wi/wi-extension"
    ],
    "outFiles": [
        "${workspaceFolder}/workspaces/wi/wi-extension/dist/**/*.js",
        "${workspaceFolder}/workspaces/wi/wi-webviews/lib/**/*"
    ],
    "skipFiles": [
        "**/node_modules/**"
    ],
    "rendererDebugOptions": {
        "sourceMaps": true,
        "webRoot": "${workspaceFolder}/workspaces/wi/wi-webviews",
    },
    "preLaunchTask": "npm: watch-wi",
    "envFile": "${workspaceFolder}/workspaces/wi/wi-extension/.env"
}

Webpack config

output: {
        path: path.resolve(__dirname, "lib"),
        filename: "main.js",
        library: "visualizerWebview",
        devtoolModuleFilenameTemplate: function (info) {
            return "file:///" + encodeURI(info.absoluteResourcePath);
        },
        publicPath: "http://localhost:3000/lib/",
    }
Image Image Image Image Image

VS Code Version: 1.105.1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.