Incorrect line numbers in stack trace


#1

I’m currently developing a new package (that will provide a backend service for the ide-haskell package). Since my service doesn’t provide all the callbacks yet that ide-backend calls, I get regular “undefined is not a function” errors; unfortunately, the stack trace that I’m getting for these errors points to the wrong line numbers inside the ide-haskell package; sometimes these line numbers even point past the end of the file. It doesn’t matter whether I install this package normally or using apm develop (and then run with --dev). However, as soon as I make one trivial change to the file in which the error occurred (adding a console.log, say) the line numbers are now suddenly correct. Some kind of precompilation, with the reported line numbers pointing to the compiled sourced perhaps?


#2

If you write your packages in CoffeeScript, they are first compiled to JavaScript before Atom can run them. The line numbers that are logged refer to that compiled JavaScript.


#3

If you are talking about coffeescript then this is built-in. The transpiler adds the line numbers to the emitted javascript and the chrome dev tools show the original coffescript with the correct line numbers displayed. All you have to do is enable javascript source mapping in the chrome inspector settings.