vscode-js-debug icon indicating copy to clipboard operation
vscode-js-debug copied to clipboard

Webview debug breakpoints not binding to the source file

Open gigara opened this issue 1 month ago • 3 comments

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

gigara avatar Oct 22 '25 20:10 gigara

Can you share logs using the instructions in the issue template?

connor4312 avatar Oct 22 '25 21:10 connor4312

I've sent an email.

gigara avatar Oct 23 '25 04:10 gigara

@connor4312 Any update?

gigara avatar Nov 03 '25 15:11 gigara