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 become disabled after start up #1080

Closed
dfdumaresq opened this issue Aug 18, 2021 · 9 comments
Closed

Breakpoints become disabled after start up #1080

dfdumaresq opened this issue Aug 18, 2021 · 9 comments
Assignees
Labels
author-verification-requested Issues potentially verifiable by issue author bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Milestone

Comments

@dfdumaresq
Copy link

dfdumaresq commented Aug 18, 2021

Describe the bug
Breakpoints on .tsx or .cs files are shown as enabled before running project. After starting the project, the breakpoints on .tsx files are greyed out and display 'No symbols have been loaded for this document', the breakpoints on the C# files remain enabled.
It is possible to start the debugger in a .tsx file by adding "debugger;" to the source code.

To Reproduce
Steps to reproduce the behavior:

  1. Set breakpoints on Welcome.tsx and .VouchersController.cs files and notice both are red
  2. Start Project
  3. Notice breakpoint on Welcome.tsx file is now grey

VSCode Developer Tools

  1. After starting project, notice error in console:
    DevTools failed to load source map: Could not load content for https://ticino.blob.core.windows.net/sourcemaps/379476f0e13988d90fab105c5c19e7abc8b1dea8/core/vs/workbench/workbench.desktop.main.js.map: Load canceled due to load timeout

Log File
vscode-debugadapter-ebc69a8f.json.gz

VS Code Version:
Version: 1.59.0 (Universal)
Commit: 379476f0e13988d90fab105c5c19e7abc8b1dea8
Date: 2021-08-04T23:14:40.191Z
Electron: 13.1.7
Chrome: 91.0.4472.124
Node.js: 14.16.0
V8: 9.1.269.36-electron.0
OS: Darwin x64 20.6.0

Node Version

  • node: v14.17.3

Additional context

  • Problem started after the deprecation notice was added to the Chrome Javascript Debugger extension. (About 2 weeks ago). So I have switched over to the built-in JS debugger (tried Nightly but made no difference).
  • It is possible to start the js-debugger in Welcome.tsx by adding debugger; to a line. This opens a read-only file and allows debugging, but not a solution. I am trying to figure out if the sourceMaps are not correctly specified.
  • Also notice periodically that Developer Tools throws
    -- ERR TreeError [CallStackView] Data tree node not found: [object Object]: Error: TreeError [CallStackView] Data tree node not found

Launch config (removed sourceMapPathOverrides)

        {
            "type": "pwa-chrome",
            "request": "launch",
            "name": "Chrome",
            "url": "https://localhost:8080",
            "webRoot": "${workspaceFolder}/ClientApp/src",
            "sourceMaps": true,
            "outFiles": [
                "${workspaceFolder}/ClientApp/build/*.js",
                "!**/node_modules/**"
            ],
            "trace": true
        },

        {
            "command": "cd ClientApp ; npm run start:dev",
            "name": "Run npm start",
            "request": "launch",
            "type": "node-terminal"
        },
        {
            "name": ".NET Core Launch (web)",
            "type": "coreclr",
            "request": "launch",
            "preLaunchTask": "build",
            "program": "${workspaceFolder}/bin/Debug/netcoreapp3.1/ManagementConsole.dll",
            "args": [],
            "cwd": "${workspaceFolder}",
            "stopAtEntry": false,
            "internalConsoleOptions": "openOnSessionStart",
            "launchBrowser": {
                "enabled": true,
                "args": "${auto-detect-url}",
                "windows": {
                    "command": "cmd.exe",
                    "args": "/C start ${auto-detect-url}"
                },
                "osx": {
                    "command": "open"
                },
                "linux": {
                    "command": "xdg-open"
                }
            },
            "env": {
                "ASPNETCORE_ENVIRONMENT": "Development"
            },
            "sourceFileMap": {
                "/Views": "${workspaceFolder}/Views"
            }
        },
@dfdumaresq dfdumaresq added the bug Issue identified by VS Code Team member as probable bug label Aug 18, 2021
@dfdumaresq dfdumaresq changed the title Breakpoints become inactive Breakpoints become inactive after start Aug 18, 2021
@dfdumaresq dfdumaresq changed the title Breakpoints become inactive after start Breakpoints become disabled after start Aug 18, 2021
@dfdumaresq dfdumaresq changed the title Breakpoints become disabled after start Breakpoints become disabled after start up Aug 18, 2021
@connor4312
Copy link
Member

It looks like the sourceMapPathOverrides. If you remove that property and use the defaults, sources should map correctly. If not, please grab a fresh log.

@connor4312 connor4312 added *question Issue represents a question, should be posted to StackOverflow (VS Code) and removed bug Issue identified by VS Code Team member as probable bug labels Aug 18, 2021
@dfdumaresq
Copy link
Author

I've removed the property sourceMapPathOverrides as you suggested, but same thing. Here's the fresh log:
vscode-debugadapter-a47b0baf.json.gz

@connor4312
Copy link
Member

It looks like your webRoot should also be "webRoot": "${workspaceFolder}/ClientApp", not "webRoot": "${workspaceFolder}/ClientApp/src",

@dfdumaresq
Copy link
Author

dfdumaresq commented Aug 19, 2021

Thanks @connor4312 - I've fixed that webRoot path and am adding a fresh log.
I have the same results, so I'm wondering if this is something else (Electron)? The most striking effect is that the moment I start either the C# or the Node process, the breakpoint goes grey. (Unbound). Reloading the browser does not help either.
Here's the log
vscode-debugadapter-32675f82.json.gz

@dfdumaresq
Copy link
Author

@connor4312, I've recently discovered that my breakpoints die on .tsx files only. They're working as expected on .ts, and .cs files with pwa-chrome.

@connor4312
Copy link
Member

connor4312 commented Oct 7, 2021

Oh, I see something interesting. There's a NUL byte in the generated paths: ./src/Dashboard/\u0000#containers/Welcome.tsx. I can reproduce that in an ordinary webpack config, that gets inserted if I have a # in my path. I think it should always be appropriate and safe to strip NUL bytes from the strings.

@connor4312 connor4312 reopened this Oct 7, 2021
@connor4312 connor4312 added bug Issue identified by VS Code Team member as probable bug and removed *question Issue represents a question, should be posted to StackOverflow (VS Code) labels Oct 7, 2021
@connor4312 connor4312 added this to the October 2021 milestone Oct 26, 2021
@alexr00 alexr00 added author-verification-requested Issues potentially verifiable by issue author verification-steps-needed Steps to verify are needed for verification labels Oct 28, 2021
@alexr00
Copy link
Member

alexr00 commented Oct 28, 2021

@connor4312 what is the best way to verify this?

@connor4312
Copy link
Member

Create a "hello world" webpack app and have a file containing a # in its path included in the build. Verify that you can set a breakpoint in that file.

@alexr00
Copy link
Member

alexr00 commented Oct 29, 2021

The breakpoint still shows as disabled, but it does break.

@alexr00 alexr00 added verified Verification succeeded and removed verification-steps-needed Steps to verify are needed for verification labels Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author-verification-requested Issues potentially verifiable by issue author bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants