ADR
ADR

Reputation: 1291

Debug JavaScript in IntelliJ IDEA

How can I debug JavaScript for my website in IntelliJ IDEA without changing my build configuration?

I am able to debug the JavaScript in Chrome Console but it does not work very well.


Answer. It is really easy:

Answer

Upvotes: 5

Views: 9206

Answers (3)

bdskfsdk321dsad3
bdskfsdk321dsad3

Reputation: 143

It is worth noting that you should have linked separate .js files for debugging. I was trying to debug JavaScript code which was within an .html file but the breakpoints were never hit. I looked later under the resources in Chrome Inspector and found out that the lines were not synchronized between the files, because for the debugger the first line was the first JavaScript line, but for the html file it was the first line of the file (DOCTYPE)

Upvotes: 0

lena
lena

Reputation: 93728

Create a new JavaScript Debug Run configuration and specify the WAMP address you normally use to open your application in browser as URL there. See https://www.jetbrains.com/help/webstorm/2017.2/debugging-javascript-in-chrome.html#d45520e154 and linked topics. You might also need to configure URL mappings in your configuration - https://www.jetbrains.com/help/webstorm/2017.2/debugging-javascript-deployed-to-a-remote-server.html#d46122e202

Upvotes: 3

shirel
shirel

Reputation: 91

First you need to add intellij plugin for chrom and install it on chrom, then on configuration debug you need to choose run with javascript. I can show you screenshot if you want

Upvotes: 1

Related Questions