trentm / node-bunyan

a simple and fast JSON logging module for node.js services
Other
7.15k stars 513 forks source link

Error.captureStackTrace is not a function in firefox #224

Open olsonpm opened 9 years ago

olsonpm commented 9 years ago

Erraneous code:

https://github.com/trentm/node-bunyan/blob/master/lib/bunyan.js#L143

I didn't take the time to check out what captureStackTrace does exactly to find if any other code depended on it. In my fork I'm just wrapping it which seems to work fine:

if (typeof Error.captureStackTrace === 'function') {
  // capture the stack
}

Again, firefox 35.0.1 on ubuntu 14.10

ShayMatasaro commented 8 years ago

still seeing it on FF 45.0

fahad19 commented 7 years ago

ended up here while dealing with Firefox issue, since it doesn't have Error.captureStackTrace.

Error().stack works universally.

rajan-gupta-12 commented 3 weeks ago

WOW, I tried the below approach and it worked for me :)

  1. Run npm i error-polyfill
  2. Add import "error-polyfill" to the index.tsx / app.tsx ( main loading file of application )