Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breakpoints set in HTML script blocks not in a function will never be hit on page refresh #884

Closed
EricCornelson opened this issue Dec 9, 2020 · 0 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@EricCornelson
Copy link
Contributor

Describe the bug
It is not possible to hit breakpoints in HTML script blocks on code that executes on page load (e.g. code not in a function that will be triggered later by user action)

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>

repro 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"
            }
        }
    ]
}

Steps:

  1. Launch the debug session with no breakpoints set
  2. Set a breakpoint on line 4 of the repro HTML above console.log('log outside a function') (the breakpoint should bind)
  3. refresh the page
  4. See that the breakpoint becomes unbound, and is not hit

Repro2_12-9-2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

2 participants