stacktracejs/stacktrace.js

Can't get the correctly stackFrames array when use fromError

shikelong opened this issue · 2 comments

Expected Behavior

Get the stackFrames array contain the corrent function name and position info.

Current Behavior

now:

[
    {
        "functionName": "[object Object]"
    },
    {
        "functionName": "[object Object]"
    }
]

my code:

import StackTrace from 'stacktrace-js';
.....
window.addEventListener('error', (event) => {
    StackTrace.fromError(event.error).then((stackFrames) => {
      const stringifiedStack = stackFrames.map((sf) => `\t at ${sf}`).join('\n');
      console.error('Global Event Report: \n ', stringifiedStack);
    }).catch((error) => {
      console.error(error.toString());
    });
    return true;
  });

Context

I use webpack to bundle my project. use 'devtool: 'source-map'

Your Environment

  • stacktrace.js version: 1.3.1
  • Browser Name and version: chrome Version 55.0.2883.87 m (64-bit)
  • Operating System and version (desktop or mobile): desktop windows 10

Regards.

I re run my project. now it's ok. But I don't know the reason.

FYI - I just saw this issue with version 2.0.0. Ended up downgrading to 1.3.1 and all is well.