Wrong line number in console stack trace
See original GitHub issueHi,
When an error occurs in a karma test, the line number is always the same number that does not match with the real line number where the error occurs:
Karma version: 0.12.17 Node: v0.10.25
Chrome 36.0.1985 (Mac OS X 10.9.4) Controller: blablaController should do some stuff FAILED
Expected spy foo.bar to have been called with [ 'foobar' ] but it was never called.
Error: Expected spy foo.bar to have been called with [ 'foobar' ] but it was never called.
at null.<anonymous> (/Users/me/workspace/foobar/app/common/foobarCtrl.spec.js:9:6615)
What should we do to get good line number ? On line 9 there is no code at all, its an empty line.
Any suggestion ?
Issue Analytics
- State:
- Created 9 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
StackTrace return wrong line number of exception in release ...
This is why default project settings remove line number info, it can't be reliable. Nor are stack traces, methods can disappear wholesale. What ......
Read more >Wrong exception line number in stack trace in release mode
When I checked line 61, there was no possibility of error at all, only a prototype class was created on line 61. A...
Read more >An error directs to a wrong line in the ... - Unity Issue Tracker
Resolution Note: Source code line numbers in managed stack traces might be wrong when the Unity editor is compiling code in release mode...
Read more >449797 – Wrong line numbers in the stack trace - Bugs - Eclipse
I have added option -XnoInline and I see no difference in stacktraces. Lines which correspond to original method names are wrong ( it...
Read more >Line numbers are incorrect in exception stack trace : KT-8628
In which console exactly are you clicking the link? Line numbers greater than the number of lines in the file are expected behavior...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We think this comes from our use of istanbul for code coverage.
istanbul reduce our code base to a file with all the code on one line to be able to check if we execute all the code or not.
if I disable istanbul, it works.
but we should be able to use istanbul with karma and to be able to know on which line of code an error occurs.
regards
Upgrading karma-coverage fixes this problem.
See also https://www.npmjs.com/package/karma-coverage#dont-minify-instrumenter-output