Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome console giving me line number from start of <script> and not top

This has been bugging me for a while. At some point my Chrome console started logging the line number from the start of my JS <script> tag and not from the top of the file. I think I might have changed something as it was doing the opposite some time ago.

In this example, Chrome is spitting out 'hello' as being on line 20 (270-250=20), not 270 as it was.

<html> - line 1
...
<script> - line 250
...
console.log('hello') - line 270

Unfortunately it has made this highly helpful feature basically useless. Has anybody experienced this?

like image 929
Ryan Grush Avatar asked Nov 12 '22 22:11

Ryan Grush


1 Answers

Please try updating your Chrome version. It works fine for me at least on Chrome 22 and later... If it still fails for you, you can file a new bug at http://new.crbug.com, its summary starting with "DevTools:". Also, providing a publicly available test case will drastically reduce the bug triage and investigation time (remember, a simplistic case worked for me on Chrome 22!)

like image 180
Alexander Pavlov Avatar answered Jan 04 '23 01:01

Alexander Pavlov