Reputation: 71
Environment:
{
"type": "pwa-chrome",
"request": "attach",
"name": "Attach Chrome Debugging to Browser for VSCode",
"port": 9222,
"url": "http://localhost:8888/",
"urlFilter": "http://localhost:8888/*",
"webRoot": "${workspaceFolder}"
}
/
)/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 --user-data-dir=remote-debug-profile
debugger;
statement in my HTML file.Using "attach" I want to be able to have the breakpoint activate inside of the actual file in VSCode, not a "Read-Only" version.
I've spent about two hours researching this issue and as far as I can tell it has to do with:
--user-data-dir=remote-debug-profile
line in the terminal command."type": "chrome"
"webRoot": "*/thedirectpathtomyprojectdirectory*"
"webRoot": "${workspaceFolder}/src"
"userDataDir": "/Library/Application\ Support/Google/Chrome/Profile 1"
"userDataDir": "/Library/Application\ Support/Google/Chrome"
"sourceMapPathOverrides": {"webpack://?:*/*": "${workspaceFolder}/*"}
"sourceMaps": true
Upvotes: 3
Views: 912
Reputation: 537
The problem is with --user-data-dir=remote-debug-profile
See here - https://chromium.googlesource.com/chromium/src/+/HEAD/docs/user_data_dir.md
You need to supply an actual directory path.
Copy your current User Data folder to your custom dir
Point chrome shortcut to the custom dir using the --user-data-dir parameter
Upvotes: 2