question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Stack trace with wrong line number

See original GitHub issue

🐛 Bug Report

Promise-based test (maybe not only promise-based) fails with wrong stack trace (jest points to wrong line number). Maybe this issue somehow related to https://github.com/facebook/jest/issues/6108 or https://github.com/facebook/jest/issues/6556 or https://github.com/facebook/jest/issues/6424, but I can reproduce this bug with and without watch mode.

image

To Reproduce

Don’t know what exactly causes this issue. Simply run yarn jest or yarn jest --watch

Expected behavior

Jest will point to right line that caused error.

Link to repl or repo (highly encouraged)

Here is repo with buggy test.

Run npx envinfo --preset jest

npx: installed 1 in 1.425s

  System:
    OS: Linux 4.15 Ubuntu 18.04.1 LTS (Bionic Beaver)
    CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
  Binaries:
    Node: 8.12.0 - /usr/bin/node
    Yarn: 1.12.3 - /usr/bin/yarn
    npm: 6.4.1 - /usr/bin/npm
  npmPackages:
    jest: ^23.6.0 => 23.6.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

9reactions
ArtemGovorovcommented, Feb 22, 2019

there’s a bug in source-map-support not mapping back properly

@SimenB It is indeed the case. Looks like the bug was introduced in source-map-support by this pull request. I have created the pull request to fix it. It should also address https://github.com/facebook/jest/issues/6424.

1reaction
fotonmotoncommented, Nov 25, 2018

@rickhanlonii thanks! If I can help somehow please write me, because this bug annoys me too much 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Wrong line numbers in stack trace
If the behavior is still the same (wrong line number) then you know it has something to do with your project / build...
Read more >
StackTrace incorrect line number - MSDN - Microsoft
It means the .pdb file is not the same version as the dll. Build the project using the debug configuration then deploy the...
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 >
Line numbers are incorrect in exception stack trace : KT-8628
A .class file with inline functions contains code from many source files, and when the JVM is generating a stacktrace, there is no...
Read more >
Protrace ABL stack shows wrong line number either ...
The ABL Stack Trace in the protrace file shows a very large number that does not correspond to the r-code: 4294967295 is what...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found