Skip to content

TypeError: Column must be greater than or equal to 0, got -62 #148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
basarat opened this issue Sep 5, 2016 · 5 comments
Open

TypeError: Column must be greater than or equal to 0, got -62 #148

basarat opened this issue Sep 5, 2016 · 5 comments

Comments

@basarat
Copy link

basarat commented Sep 5, 2016

Stack trace :

TypeError: Column must be greater than or equal to 0, got -62
    at SourceMapConsumer_findMapping [as _findMapping] (D:\REPOS\alm\node_modules\source-map-support\node_modules\source-map\lib\source-map\source-map-consumer.js:281:15)
    at SourceMapConsumer_originalPositionFor [as originalPositionFor] (D:\REPOS\alm\node_modules\source-map-support\node_modules\source-map\lib\source-map\source-map-consumer.js:310:26)
    at mapSourcePosition (D:\REPOS\alm\node_modules\source-map-support\source-map-support.js:188:42)
    at wrapCallSite (D:\REPOS\alm\node_modules\source-map-support\source-map-support.js:327:20)
    at D:\REPOS\alm\node_modules\source-map-support\source-map-support.js:362:26
    at Array.map (native)
    at Function.prepareStackTrace (D:\REPOS\alm\node_modules\source-map-support\source-map-support.js:361:24)
    at process.emit (D:\REPOS\alm\node_modules\source-map-support\source-map-support.js:411:51)
    at process._fatalException (node.js:237:26)

Tracked it down to

if (line === 1 && !isInBrowser() && !frame.isEval()) {
column -= 62;
}
moving it to -62.

More

The code I am working on is available here : alm-tools/alm#181. However might be easiest to just ask me to log whatever you want and I'll send it throught 🌹

@basarat
Copy link
Author

basarat commented Sep 5, 2016

The basic issue is that the code hotfix for #36 assumes that there will be (function (exports, require, module, __filename, __dirname) { at the head of my file. That is not the case I am seeing in my invocation. Below I am logging out the line,column at

// Fix position in Node where some (internal) code is prepended.
along with file at originalPositionFor

{ line: 1, column: 0 }
{ source: 'D:\\REPOS\\alm\\src\\tests\\testedTest.ts',
  line: 1,
  column: -62 }

My file starts with a call to describe hence line 1 column 0 🌹

@basarat
Copy link
Author

basarat commented Sep 5, 2016

A PR fix for this exists : #138 🌹

@basarat
Copy link
Author

basarat commented Sep 7, 2016

Didn't work with node 5.2.0. But works with 5.10.1.

Having two machines with different OSes / nodejs versions helped me figure that out :). I'll also try newer node version once they are more stable

@RobinTail
Copy link

RobinTail commented Mar 16, 2023

The issue is still present in Jest

TypeError: Column must be greater than or equal to 0, got -32

=> Found "[email protected]"
info Reasons this module exists
   - "jest#@jest#core#jest-runner" depends on it
   - Hoisted from "jest#@jest#core#jest-runner#source-map-support"

UPD: I switched to vitest

@chrisryanouellette
Copy link

Also still experience this on jest version 29.7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants