I am using VS Code, and I'd like to set breakpoints in my TS files and step through them. I am launching an electron-based Angular application with node. My application successfully launches, but I when I hover over my breakpoints I see:
Breakpoint ignored because generated code not found (source map problem?)
My package.json
heading looks like:
{
"name": "angular-test",
"version": "0.0.0",
"main": "main.js",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build --base-href ./",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"electron": "ng build --base-href ./ && electron .",
"electron-tsc": "tsc main.ts && ng build --base-href ./ && electron ."
},
and my launch.json
looks like:
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}\\main.js",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
"preLaunchTask": "npm: build",
"args" : ["."],
"outFiles": [
"${workspaceFolder}/dist/*.js"
],
"protocol": "inspector"
}
]
}
I think this may be caused by webpack, e.g., at the top of my main.js.map
I have: {"version":3,"sources":["webpack:///./src/$_lazy_route_resource lazy namespace object","webpack:///./src/app/app-routing.module.ts"
But from what I understand, inspector
should not be sensitive to webpack.