PhpStorm not stopping on breakpoints in Chrome Follow
JavaScript breakpoints were working in Chrome as of a couple weeks ago, but are not working today. I did update PhpStorm yesterday and my Java runtime a few days ago, so one of those may be the culprit.
Windows 7 64bit
PhpStorm 7.1.2 build 133.803
JRE 170_40-b43 x86
Chrome 32.0.1700.107 m
JetBrains IDE Chrome extension 2.0
Steps to reproduce:
- Run PhpStorm
- File > New Project...
- Create an Empty project
- In project context menu, New > HTML File (name it "index")
- Edit text in file to this:
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
</body>
<script>
var a = 1;
</script>
</html>
- Set a breakpoint on line 10 ("var a = 1")
- In editor context menu, Debug 'index.html'
When I do this, it opens a tab in Chrome with a notification that "JetBrains IDE Support" is debugging this tab. In PhpStorm, in the Debugger > Variables tab, it says Connected to JetBrains Chrome Extension. If I close the tab in Chrome, it disconnects.
The debugger is clearly connecting to Chrome, but it never stops on any breakpoints.
A zip file with the test project is attached.
Attachment(s):
test.zip
Please sign in to leave a comment.
Hi there,
I've just tried your test project.
It did not break at first attempt, but when I refreshed the page in browser (F5) it stopped just fine.
Ah, that did it! Thanks.
Any idea why I need to refresh the page to debug now (when I didn't need to earlier)?
No clue.
Hello!
See http://youtrack.jetbrains.com/issue/WEB-10732 (fixed in WebStorm8).
actually the issue is caused by the way the Chrome script preprocessor works - it uses absolute addressing, so for embedded javascript the returned address may be larger than the overall script length, that's why the returned line breaks positions are outside of the <script> block. In WebStorm 8 we will be using our own preprocessor instead of Chrome one - this should solve the problem
Since Andriy's previous comment effectively solved the problem for me, I've gone ahead and given Andriy's post above the points for correct answer.