admin管理员组

文章数量:1315811

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:

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:

Share Improve this question edited Jul 10, 2019 at 12:19 informatik01 16.4k11 gold badges78 silver badges108 bronze badges asked Sep 7, 2017 at 14:43 ADRADR 1,2919 silver badges21 bronze badges 6
  • what instructions you refer to? Normally changing build configuration is not required (unless it doesn't allow code debugging - no valid sourcemaps produced, etc.). I can hardly advise on setting up the debugger unless you provide a project I can play with – lena Commented Sep 7, 2017 at 17:19
  • This project uses WAMP server.I think It will look like I am trying to debug foreign site. Can I do it? Can I connect a debugger to any web site in chrome? – ADR Commented Sep 7, 2017 at 17:58
  • sure - ust specify the URL of your app on WAMP in JavaScript Debug run configuration – lena Commented Sep 7, 2017 at 18:12
  • Thank you for your answer! But I can not find this in settings... Can you write a path or make a screenshot? Of course, I tried to find a solution on the Internet but all they were very hard or unresolved for WAMP server. – ADR Commented Sep 7, 2017 at 21:33
  • 1 what settings? Just create a new JavaScript Debug run configuration and specify the address you normally use to open your application in browser as URL there. See jetbrains./help/webstorm/2017.2/… and linked topics – lena Commented Sep 8, 2017 at 9:57
 |  Show 1 more ment

3 Answers 3

Reset to default 3

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./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./help/webstorm/2017.2/debugging-javascript-deployed-to-a-remote-server.html#d46122e202

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

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)

本文标签: google chromeDebug JavaScript in IntelliJ IDEAStack Overflow