Breakpoints set in HTML script blocks before launch are never bound #883
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"
}
}
]
}
- Using the repro files above, set a breakpoint anywhere in the script block
- Launch
- See that the breakpoint is not bound.
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