Skip to content

Breakpoints set in HTML script blocks before launch are never bound #883

Closed
@EricCornelson

Description

Describe the bug
Setting a breakpoint in a script block inside an html file before launching the debug session will cause the breakpoint to not be bound, and further can prevent any breakpoints from ever being bound in that script block during that debug session, even across page refreshes.

To Reproduce

Repro html:

<html>
    <body>
        <script>
            console.log('log outside a function');
            function clickme() {
                console.log('log inside a function');
            };
        </script>
        <button onclick="clickme()">Click Me</button>
    </body>
</html>

launch.json:

{
    "configurations": [
        {
            "name": "Launch Chrome",
            "request": "launch",
            "type": "pwa-chrome",
            "url": "http://localhost:5000",
            "webRoot": "${workspaceFolder}",
            "trace": {
                "logFile": "C:/dev/repros/basic/log.txt"
            }
        }
    ]
}
  1. Using the repro files above, set a breakpoint anywhere in the script block
  2. Launch
  3. See that the breakpoint is not bound.

BugRepro_12-9-2020

The second part of the bug here (preventing any breakpoints from being bound) seems to only happen in this particular scenario after I've clicked the "click me" button, whereas if I unset and reset the breakpoint before clicking the button, it will bind.

Log File
log.txt

VS Code Version:
Version: 1.52.0-insider (user setup)
Commit: ac165d7f974d70212be80cb15eaecfc1fd20b21a
Date: 2020-11-30T17:36:25.607Z
Electron: 11.0.2
Chrome: 87.0.4280.63
Node.js: 12.18.3
V8: 8.7.220.24-electron.0
OS: Windows_NT x64 10.0.19042

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions