angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Question: Use VS Code Debugging in CLI project, i.e. use F5 to launch project, and debug in VS Code?

Open daBishMan opened this issue 9 years ago • 5 comments

Please provide us with the following information:

OS?

Windows 10.

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here: @angular/cli: 1.0.0-rc.0 node: 7.6.0 os: win32 x64 @angular/common: 2.4.8 @angular/compiler: 2.4.8 @angular/core: 2.4.8 @angular/forms: 2.4.8 @angular/http: 2.4.8 @angular/platform-browser: 2.4.8 @angular/platform-browser-dynamic: 2.4.8 @angular/router: 3.4.8 @angular/cli: 1.0.0-rc.0 @angular/compiler-cli: 2.4.8

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc. Trying to use F5 to launch CLI project in VS Code.

The log given by the failure.

Normally this include a stack trace and some more information. NA

Mention any other details that might be useful.

I am trying to find a supported way to enable debugging a CLI project in VS Code by launching the application using F5.


Thanks! We'll be in touch soon.

daBishMan avatar Mar 02 '17 14:03 daBishMan

I've been able to debug in VSCode using the Debugger for Chrome extension, and a launch config similar to this:

 {
            "name": "Launch Client",
            "type": "chrome",
            "request": "launch",
            "url": "http://localhost:4200/#",
            "port": 9223,
            "sourceMaps": true,
            "diagnosticLogging": true,
            "webRoot": "${workspaceRoot}",
            "runtimeArgs": [
                "--disable-session-crashed-bubble",
                "--disable-infobars"
            ],
            "userDataDir": "${workspaceRoot}/.vscode/chrome"
        }

It doesn't actually start the app inside VSCode, but if you start it outside (ng serve) then you can hit F5 to launch the debugger part.

Mayjest avatar Mar 02 '17 22:03 Mayjest

When I use the above configuration I get an exception on the polyfills.bundle.js

phmello avatar Mar 03 '17 05:03 phmello

Thank you! Works with this configuration.

timurmelnikov avatar Mar 03 '17 11:03 timurmelnikov

Closing as fixed.

hansl avatar Mar 04 '17 01:03 hansl

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.