I've had this problem and have found its root cause for my case.
The js file had a mix of different line ending characters. While the file displays correctly in the debugger, the function internally is being represented as one line by the intepreter.
For example, the debugger displays:
function a() {
b;
c;
d;
}
then type a in the console to see the implementation, it shows everything on one line"
{ b; c; d; }
The file is then shifted after this function permanently
I have my workaround to fix the file. But I have noticed this issue in some 3rd party libraries. It would be nice to have the file shown consistently compared to what the interpreter see.
Thanks!