问题
I am using Intellij IDEA 12.0.4 + Chrome while remote debugging Javascript. My debugging session gets at a point where there is no breakpoint set at all. In my case, it is the last line of my script. The same happens with Chrome debugging. Since both tools are having the same problem, I assumed there is something wrong with the script file.
Is there a solution to this annoying problem?
PS: Versioning system is Git.
Pics attached:
http://s12.postimage.org/n8sz1uyq5/Screen_Shot_2013_03_17_at_9_05_41_AM.png http://s8.postimage.org/3lv46pnit/Screen_Shot_2013_03_17_at_9_06_51_AM.png
回答1:
The reason was that the browser was not reloading the code correctly and was caching all the contents. Here is the instruction for Mac users (Close enough for other users).
First in Intellij IDEA you should invalidate the cache by going to File --> Invalidate Caches
Second, in Chrome, Press Cmd + alt + Backspace (You can also go to Settings --> History ---> Clean Browsing Data). Check empty the Cache and click on Clear Browsing Data.
In Firefox, By going into Pretences and inside Privacy tab, click on clear your recent history. From the "Clear All History" check Everything as Time Range and check Cache and then click on Clear Now button.
(You get the idea for all browsers here ...)
Stop the debug server, and re-start it. It should be OK now!
回答2:
Share your script to debug. Most probably the error might be, you could missed the string concatenation. or '/" not closed properly. please check once again(last modified function/method in your code).
回答3:
Do not use tabs in code. I found this problem on Chrome 72.
来源:https://stackoverflow.com/questions/15458794/javascript-stops-at-a-line-without-a-breakpoint-in-remote-debug-mode