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

Understand needed update to webRoot or sourceMapPathOverrides #1596

Open
brentgracey opened this issue Mar 6, 2023 · 6 comments
Open

Understand needed update to webRoot or sourceMapPathOverrides #1596

brentgracey opened this issue Mar 6, 2023 · 6 comments

Comments

@brentgracey
Copy link

The Debug Diagnostics is trying its best to help me with the below error message; but I'm still not sure how to work out the required updates.

Screenshot from 2023-03-06 18-13-47

What does it mean by; "couldn't find a corresponding source location"?
I think its because it can't find the source maps?

What path is it looking for the corresponding "source location" on?
How am I supposed to read the red/ green and not highlighted part of the other files with the same name message?
Is the red, parts of the path it was looking for that don't match the paths of the other files with the same names?

I tried updating webRoot and sourceMapPathOverrides; but the error message didn't change.

My launch.json is as below.

 {
      "type": "chrome",
      "request": "launch",
      "name": "vuejs: chrome",
      "url": "http://localhost:8080",
      "webRoot": "${workspaceFolder}",
      "sourceMaps": true,
      "sourceMapPathOverrides": {
        "webpack:/*": "${webRoot}/*",
        "/./*": "${webRoot}/*",
        "/src/*": "${webRoot}/*",
        "/*": "*",
        "/./~/*": "${webRoot}/node_modules/*"
      }
@connor4312
Copy link
Member

The sourceMapPathOverrides are case-insensitive but exact. It looks like you have a webpack URI which doesn't match any of the overrides, which leads to the debugger trying to form a path with it in the second text diff and putting in a path like foo/webpack:/something.

You often should not need to update sourceMapPathOverrides at all. The defaults are good, and overriding them causes issues more often than not.

@brentgracey
Copy link
Author

Looking at the Sources tab in Chrome Dev tools I see the below domains

I see webpack-internal in there; judging by the defaults - I guess this has been updated from what would normally be webpack?

Screenshot from 2023-03-06 18-31-46

@connor4312
Copy link
Member

connor4312 commented Mar 6, 2023

webpack-internal can be there and normally is not what you actually want to map to source files when debugging. For Vue particularly this is usually some extra files they use for loading CSS/JS, if I recall correctly.

If you're able to share the log file, I can diagnose this a bit further 🙂

@brentgracey
Copy link
Author

In vs-code; in the loaded scripts tab I see
Screenshot from 2023-03-06 18-36-55

... checking the logs now; I see they are written to a zip file

@brentgracey
Copy link
Author

I see the log message

Verbose logs are written to:
/root/.vscode-server/data/logs/20230303T074819/exthost7/ms-vscode.js-debug/vscode-debugadapter-5c185aae.json.gz

But that file does not exists

cd /root/.vscode-server/data/logs/20230303T074819/exthost
exthost1/ exthost2/ 

I am running connected to a docker container.

@connor4312
Copy link
Member

That log is written to whatever machine your workspace is on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants