3

I get the following error "ReferenceError: printStackTrace is not defined", when I tried to use StackTrace in my angular aplication.

Peter
  • 55
  • 5
  • 4
    please provide code and logs – MemLeak Nov 30 '15 at 21:05
  • 1
    I should use `StackTrace.fromError(error).then(callback).catch(errback);` and not `printStackTrace({e: error})`. `printStackTrace()` is for the old versions v0.x: – Peter Dec 01 '15 at 00:59

1 Answers1

4

stacktrace.js changed the API for v1.0.

You'll want to use

var callback = function(frames) { console.log(frames); };
var errback = function(err) { console.log(err.message); };

StackTrace.get().then(callback).catch(errback);

as suggested by the docs.

If all you want to do is parse an Error you can just use error-stack-parser

Please refer to the v0.x -> v1.x migration guide if you were using the old version.

By the way, if you need to use version 0.x you can find it in the stable branch on GitHub

Eric Wendelin
  • 43,147
  • 9
  • 68
  • 92