A Visual Studio Code extension to debug your Javascript code on targets that support the Chrome Debugging Protocol.
"version": "0.2.0",
"configurations": [
{
"name": "Launch index.html with sourcemaps",
"type": "chrome",
"request": "launch",
"url": "http://localhost:4040/index.html",
"sourceMaps": false,
"webRoot": "${workspaceRoot}"
}
]
I am working on Windows 10 using a current version of Chrome.debugger;
statement, execution stops there and I can step through my code, also the breakpoints in the code following are being hit. VS Code tells me "Breakpoint ignored because target path not found" on hovering over a breakpoint. Do you have an idea how to fix this? I would also be fine with an attach configuration.
.scripts
command to see which urls are loaded. They will be resolved to files on disk using your webRoot
- see if it makes sense.
"version": "0.2.0",
"configurations": [
{
"name": "Launch index.html with sourcemaps",
"type": "chrome",
"request": "launch",
"url": "http://localhost:4040/index.html",
"sourceMaps": true,
"webRoot": "${workspaceRoot}"
}
]
made it work, with eval-source-map
it does not. I need to better understand what is going on. I will try using .scripts
to see what goes wrong when trying to use eval-source-map
.
@roblourens Thanks for the pointer. I use the sourceMapPathOverrides launch setting now and activate logging as follows:
"url": "http://localhost:4040/index.html",
"webRoot": "${workspaceRoot}/build",
"sourceMaps": true,
"sourceMapPathOverrides": {
"webpack:///./app/*": "${workspaceRoot}/app/*"
},
"diagnosticLogging": true
The breakpoints look right now in VS Code (no "target path not found any more"), but they are not being hit. When looking at the log file, it seems that the fact that webpack-dev-server uses some hash in the path for the in-memory files it serves could be the reason for the files on disk not being found(?) E.g. the log file says
SourceMap: mapping webpack:///./app/component.js?60be => c:\Users\jose\Documents\GitHub\survivejs-webpack\app\component.js?60be, via sourceMapPathOverrides entry - "webpack:///./app/*":
where of course the file on disk is just component.js, so maybe the suffix ?60be
is the reason while the file is not found.
source-map
sourcemaps using the same launch configuration makes breakpoints work. I have written up what could be the issue, but I may be wrong. Thanks again!