Georg H.
Georg H.

Reputation: 113

Debug angular app in Intellij with chrome under windows

I'm looking quite a while for a solution to debug a angular app in intellij using chrome on Windows.

At the moment I'm not able to get a debugger attached to chrome. I tried starting chreme with --remote-debugging-port=9222 and a lot of other solutions.

Currently I'm using IntelliJ 2020.2 and Chrome 86.

Does anyone have a solution for windows?

Upvotes: 5

Views: 7114

Answers (3)

Raihanul Alam Hridoy
Raihanul Alam Hridoy

Reputation: 581

I am on Mac, but I think this might be helpful for you as it resolved my issue.

The workaround is to go to:

Settings -> Tools -> Web Browsers and Preview

Edit the Chrome entry, and put --remote-allow-origins=* in the Command line options.

Steps

Reference: https://www.reddit.com/r/IntelliJIDEA/comments/120faod/comment/jdk82yz/?utm_source=share&utm_medium=web2x&context=3

Upvotes: 11

Prasanth Louis
Prasanth Louis

Reputation: 5076

If you're having the error: Please ensure that the browser was started successfully with remote debugging port opened. Port cannot be opened if Chrome having the same User Data Directory is already launched

Try removing this file:

~\AppData\Roaming\JetBrains\WebStorm2020.2\options\other.xml

If that didn't work, in addition to the above, remove this file:

~\AppData\Roaming\JetBrains\WebStorm2020.2\options\web-browsers.xml

As always remember to take backups of your files.

Upvotes: 7

lena
lena

Reputation: 93868

Please follow the steps described in Help:

  • run npm start to start your app
  • create the JavaScript Debug run configuration, specify your server URL there (http://localhost:4200/ or whatever it looks like)
  • Set the breakpoints in your code.
  • debug the configuration above

See also https://blog.jetbrains.com/webstorm/2017/01/debugging-angular-apps/

Upvotes: 0

Related Questions