Skip to content
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

Type error in long-stack-traces.js:7 #21

Open
alinex opened this issue Mar 3, 2015 · 2 comments
Open

Type error in long-stack-traces.js:7 #21

alinex opened this issue Mar 3, 2015 · 2 comments

Comments

@alinex
Copy link

alinex commented Mar 3, 2015

If i require the module in asimple mocha test:

chai = require 'chai'
expect = chai.expect
require 'long-stack-traces'
it "should work", ->
  # do nothin and succeed
  expect(1+1).to.equal 2

The following error will occure:

/home/alex/a3/node-error/node_modules/long-stack-traces/lib/long-stack-traces.js:7
e = new Error().stack.split("\n")[1].match(/^ at ((?:\w+://)?[^:]+)/)[1];
^
TypeError: Cannot read property '1' of null
at /home/alex/a3/node-error/node_modules/long-stack-traces/lib/long-stack-traces.js:7:90
at Object. (/home/alex/a3/node-error/node_modules/long-stack-traces/lib/long-stack-traces.js:265:3)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (/usr/lib/node_modules/alinex-builder/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/home/alex/a3/node-error/test/mocha/index.coffee:4:1)
at Object. (/home/alex/a3/node-error/test/mocha/index.coffee:1:1)
at Module._compile (module.js:456:26)
at Object.loadFile (/usr/lib/node_modules/alinex-builder/node_modules/coffee-script/lib/coffee-script/register.js:16:19)
at Module.load (/usr/lib/node_modules/alinex-builder/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at /usr/lib/node_modules/alinex-builder/node_modules/mocha/lib/mocha.js:185:27
at Array.forEach (native)
at Mocha.loadFiles (/usr/lib/node_modules/alinex-builder/node_modules/mocha/lib/mocha.js:182:14)
at Mocha.run (/usr/lib/node_modules/alinex-builder/node_modules/mocha/lib/mocha.js:394:31)
at Object. (/usr/lib/node_modules/alinex-builder/node_modules/mocha/bin/_mocha:394:16)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:929:3

@Nedomas
Copy link

Nedomas commented Mar 29, 2015

I'm getting the same bug

@gdw2
Copy link

gdw2 commented May 13, 2015

I think it's related to coffeescript. My coffeescript app has a top-level app.js (in javascript). If I require long-stack-traces after coffeescript, I get the error you describe. If I do it before, no error (though, admittedly, my stack traces are not longer).

require('long-stack-traces')
require('coffee-script/register');

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