如何在服务器上解码JavaScript堆栈跟踪形式的缩小代码?

时间:2014-08-29 11:20:51

标签: javascript php node.js stack-trace source-maps

我有一个用AngularJS编写的客户端应用程序,它通过API与用PHP编写的后端进行通信。要将JavaScript错误记录到服务器,我使用类似于Ben Nadel(http://www.bennadel.com/blog/2542-logging-client-side-errors-with-angularjs-and-stacktrace-js.htm)描述的方法。

问题是我的所有JS代码都缩小了,所以我的堆栈跟踪记录到服务器看起来像这样:

  TypeError: undefined is not a function : new <anonymous>@http://exmaple.com/assets/js/dist/all.min.js?v=1409233767682885224:11:21574
  e@http://exmaple.com/assets/js/dist/all.min.js?v=1409233767682885224:2:295
  Object.f [as instantiate]@http://exmaple.com/assets/js/dist/all.min.js?v=1409233767682885224:2:410
  {anonymous}()@http://exmaple.com/assets/js/dist/all.min.js?v=1409233767682885224:2:18043
  link@http://exmaple.com/assets/js/dist/all.min.js?v=1409233767682885224:5:14050
  q@http://exmaple.com/assets/js/dist/all.min.js?v=1409233767682885224:2:10396
  h@http://exmaple.com/assets/js/dist/all.min.js?v=1409233767682885224:2:6417
  {anonymous}()@http://exmaple.com/assets/js/dist/all.min.js?v=1409233767682885224:2:6040
  E.d@http://exmaple.com/assets/js/dist/all.min.js?v=1409233767682885224:2:6889
  n@http://exmaple.com/assets/js/dist/all.min.js?v=1409233767682885224:2:8873

有没有办法将它们解码为实际的代码跟踪? (我确实生成了源地图)

我正在寻找PHP或NodeJS的解决方案。

0 个答案:

没有答案