Skip to content

SourceMap mapping webpack to wrong file location in VSCode Debug #2453

@pderks

Description

@pderks

OS: Windows 10
angular-cli: 1.0.0-beta.16
node: 6.7.0

When creating a new project using the angular-cli and attempting to debug, none of the breakpoints I am setting are being hit. After looking into the log file for the debugger I have found that webpack is mapping to the wrong source location. I have listed repro steps along with the location of a log file, my launch configurations and an example of what I am seeing when I say that webpack is mapping to the wrong location. I was hoping someone had some insight into why this is happening.

Repro steps:

  1. Download Debugger for Chrome in VS Code
  2. Create new project using angular-cli
  3. Set Launch.json configurations to launch in chrome with diagnosticLogging set to true
  4. Set breakpoints in typescript files and Launch the app
  5. Log file can be found at C:\Users{{your username}}.vscode\extensions\msjsdiag.debugger-for-chrome-0.5.2\vscode-chrome-debug.txt

Example from the log (entire log file attached):
vscode-chrome-debug.txt

SourceMap: mapping webpack:///C:/Users/pderks/Desktop/test-app/src/app/app.component.ts => c:\Users\pderks\Desktop\test-app\C:\Users\pderks\Desktop\test-app\src\app\app.component.ts

**Notice that the path c:\Users\pderks\Desktop\test-app is appearing twice.

Launch configurations:
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Chrome against localhost, with sourcemaps",
"type": "chrome",
"request": "launch",
"url": "http://localhost:4200",
"diagnosticLogging": true,
"sourceMaps": true,
"webRoot": "${workspaceRoot}"
}
]
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions