stacktracejs / error-stack-parser Goto Github PK
View Code? Open in Web Editor NEWExtract meaning from JS Errors
Home Page: https://www.stacktracejs.com/#!/docs/error-stack-parser
License: MIT License
Extract meaning from JS Errors
Home Page: https://www.stacktracejs.com/#!/docs/error-stack-parser
License: MIT License
So, I already started a project to do this a while back: https://github.com/fresheneesz/stackinfo
Its already in working condition and I'm using it in several of my projects. I don't have any formal spec, and it isn't yet well tested tho. We should collaborate.
Hi Team,
while i was trying to build the package "error-stack-parser" and git URL: https://github.com/stacktracejs/error-stack-parser.git
on power(ppc64le),
getting build error with "npm". Also observed that if i build this package with "yarn" no build error or test errors are there.
I just wanted to confirm you once,
1. Is it okay if i build with "yarn" as there is no any issue with this.
2. Can you please tell me how to build this package with "npm"
tried in building package with npm :
npm : 6.4.13
node: v12.22.3
platform: ppc64le
OS: Linux
npm build error:
npm WARN lifecycle [email protected]~prepare: cannot run in wd [email protected] cp error-stack-parser.js dist/ && uglifyjs node_modules/stackframe/stackframe.js error-stack-parser.js -o dist/error-stack-parser.min.js --compress --mangle --source-map "url=error-stack-parser.min.js.map" (wd=/root/error-stack-parser)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"ppc64"})
removed 1 package and audited 593 packages in 4.26s
15 packages are looking for funding
run `npm fund` for details
found 12 vulnerabilities (3 low, 8 moderate, 1 high)
run `npm audit fix` to fix them, or `npm audit` for details
yarn build and test logs(build and test succeeded):
[root@8eef1ccfa9d3 error-stack-parser]# yarn install
yarn install v1.22.10
info No lockfile found.
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
warning [email protected]: this package is now deprecated
warning phantomjs-prebuilt > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
warning phantomjs-prebuilt > request > [email protected]: this library is no longer supported
warning phantomjs-prebuilt > request > [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
warning karma-coveralls > coveralls > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
warning karma-phantomjs-launcher > [email protected]: this package is now deprecated
warning [email protected]: support for ECMAScript is superseded by `uglify-js` as of v3.13.0
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
$ cp error-stack-parser.js dist/ && uglifyjs node_modules/stackframe/stackframe.js error-stack-parser.js -o dist/error-stack-parser.min.js --compress --mangle --source-map "url=error-stack-parser.min.js.map"
Done in 7.60s.
[root@8eef1ccfa9d3 error-stack-parser]# yarn audit
yarn audit v1.22.10
0 vulnerabilities found - Packages audited: 437
Done in 1.13s.
[root@8eef1ccfa9d3 error-stack-parser]# yarn test
yarn run v1.22.10
$ karma start karma.conf.js --single-run
21 07 2021 06:45:13.096:INFO [karma-server]: Karma v6.3.4 server started at http://localhost:9876/
21 07 2021 06:45:13.099:INFO [launcher]: Launching browsers PhantomJS with concurrency unlimited
21 07 2021 06:45:13.104:INFO [launcher]: Starting browser PhantomJS
21 07 2021 06:45:14.643:INFO [PhantomJS 2.1.1 (Linux 0.0.0)]: Connected on socket VgQk6qWFl1fvP8PcAAAB with id 59986814
PhantomJS 2.1.1 (Linux 0.0.0) ERROR LOG: 'DEPRECATION: Setting specFilter directly on Env is deprecated and will be removed in a future version of Jasmine, please use the specFilter option in `configure`'
ErrorStackParser
#parse
✓ should parse IE 11 Error stacks
✓ should parse V8 Error.stack entries with port numbers
✓ should parse Opera 11 Error messages
✓ should handle spaces in Node.js stacks
✓ should parse V8 Error.stack
✓ should parse stack traces with @ in the URL
✓ should parse V8 entries with no location
✓ should parse stack traces with @ in the URL and the method
✓ should handle newlines in Error stack messages
✓ should handle webpack eval stacks
✓ should parse nested eval() from Firefox 43
✓ should parse nested eval() from Edge
✓ should parse function names containing @ in Firefox 43 Error.stack
✓ should not parse IE 9 Error
✓ should parse Opera 25 Error stacks
✓ should parse Safari 6 Error.stack
✓ should parse Opera 10 Error messages
✓ should parse Opera 9.27 Error messages
✓ should parse error stacks with Constructors
✓ should parse IE 10 Error stacks
✓ should parse nested eval() from V8
✓ should parse Safari 7 Error.stack
✓ should parse Safari 8 Error.stack
✓ should parse nested eval() from Safari 9
✓ should parse Firefox 31 Error.stack
PhantomJS 2.1.1 (Linux 0.0.0): Executed 25 of 25 SUCCESS (0.028 secs / 0.032 secs)
TOTAL: 25 SUCCESS
Done in 2.81s.
Hi thanks for this library. It looks great all though I've had some problems getting off the starting block with it.
I've prepared an example project which shows that this library fails to parse a stack trace that has spaces in its name.
I've prepared a test project to show the problem: https://github.com/ashleydavis/stack-trace-example
Should be able to parse a stack trace for a file with spaces in it's name.
The name of the file that throws the error is "my test script.js".
As you can see by the following screenshot the initial components of the file name (before the space) are stripped out:
I've prepared an example repository:
https://github.com/ashleydavis/stack-trace-example
Clone the repo. Or download and unpack the repo.
Use npm install
to install dependencies.
Use npm start
to run the example project.
You will see the problem in the parsed stack trace that is printed to the console.
I was hoping to use your stack trace parser in my project, but I've been blocked from using it by this problem.
Sorry, no idea.
Consider this error stack:
Error
at StackTrace$$GenerateError (http://concatjs/base/third_party/javascript/cucumber_js/cucumber.js:54957:19) [ProxyZone]
at Object.StackTrace$$getSync [as getSync] (http://concatjs/base/third_party/javascript/cucumber_js/cucumber.js:55019:23) [ProxyZone]
The error-stack-parser library finds the wrong location.
The location should be http://.../cucumber.js:54957:19
.
The location it finds is [ProxyZone]
.
<Working on a repro; but let me know if you don't need one.>
I'm trying to use CucumberJS for my Angular2+ app's testing framework. CucumberJS uses this library to find relevant information of where a step is defined. Angular2+ app may be run under Zone.js
, which may use its Proxy
to do some stuff.
I'm not an export, but I guess this thing tokens.pop()
may be the culprit:
error-stack-parser/error-stack-parser.js
Line 62 in 2d84c60
I don't like the idea of losing information, so I'd rather that the "fileName" get "(native)" for tracelines like at Array.forEach (native)
.
Hi,
Looks like one of my dependencies is using your library and I get a strange error in the browser console every time the page loads:
Failed to parse SourceMap: http://example.com/error-stack-parser.min.js.map
I don't have to perform any actions in order for the error to appear.
Browser: Chrome 49.0.2623.8 (latest for OSX)
Framework: Meteor 1.3-rc.9
Strangely, the issue does apply to FF (though I don't know whether FF reads .map files or not).
What could this be caused by?
@genielabs commented on Sun Jun 26 2016
Given an error stack like this one:
ReferenceError: a is not defined
at $$.onStart (eval at <anonymous> (http://localhost:8080/hg/html/js/homegenie.webapp.js?version=r525:6851:25), <anonymous>:32:7)
at $$.RenderWidget (http://localhost:8080/hg/html/js/homegenie.webapp.js?version=r525:6770:36)
at $$.RenderView (http://localhost:8080/hg/html/js/homegenie.webapp.js?version=r525:6757:12)
at http://localhost:8080/hg/html/js/homegenie.webapp.js?version=r525:6879:24
at Object.$.ajax.success (http://localhost:8080/hg/html/js/homegenie.api.js?version=r525:724:21)
at l (http://localhost:8080/hg/html/js/jquery-2.0.2.min.js:3:24881)
at Object.c.fireWith [as resolveWith] (http://localhost:8080/hg/html/js/jquery-2.0.2.min.js:3:25702)
at k (http://localhost:8080/hg/html/js/jquery-2.0.2.min.js:5:4919)
at XMLHttpRequest.<anonymous> (http://localhost:8080/hg/html/js/jquery-2.0.2.min.js:5:8723)
stackframe will currently ignore the eval <anonymous>:32:7
at the end of the first stack element, which is the real source of the error at line 32, column 7.
It will indeed report stack[0] with line 6851 and column 25.
@eriwen commented on Fri Nov 25 2016
@genielabs Stackframe itself handles eval
origins as you can setEvalOrigin(Stackframe)
. However, error-stack-parser
does not set eval origins yet, so I'm going to move this issue to that project. Thanks for submitting.
Running a simple ErrorStackParser.parse(new Error('boom'));
on iOS9 and iOS8.3 generate an error >> 'Cannot parse given Error object'
I was using the Chrome API but have begun switching to error-stack-parser
so that I can get similar more consistent results across environments. The issue I am finding on Chromium, which didn't happen with their API, is:
StackFrame
columnNumber: 19
fileName: "http://fiddle.jshell.net/_display/"
functionName: "new"
lineNumber: 149
source: " at new CustomError (http://fiddle.jshell.net/_display/:149:19)"
Is this something that can be fixed?
Its inevitable that browsers will come up with new traceline formats for specific circumstances. The stack parser should be able to gracefully fail in those cases - the StackFrame
should simply have undefined for all its parts. Example:
CapturedExceptions.CHROME_40Garbo = {
message: "some message",
name: "Error",
stack: "Error\n"+
" at Object.StackTrace$$get [as get] (http://localhost:8100/generatedBuild/stackinfo.umd.js:3788:23)\n"+
" at 21.module.exports (http://localhost:8100/generatedBuild/stackinfo.umd.js:3923:38)\n"+
" at something-totally-unparsable\n"
}
it('should parse v8 traces with unparsable lines', function () {
debugger;
var stackFrames = unit.parse(CapturedExceptions.CHROME_40Garbo);
expect(stackFrames).toBeTruthy();
expect(stackFrames.length).toBe(3);
expect(stackFrames[0]).toMatchStackFrame(['Object.StackTrace$$get', undefined, 'http://localhost:8100/generatedBuild/stackinfo.umd.js', 3788, 23]);
expect(stackFrames[1]).toMatchStackFrame(['21.module.exports', undefined, "http://localhost:8100/generatedBuild/stackinfo.umd.js", 3923, 38]);
expect(stackFrames[2]).toMatchStackFrame([undefined, undefined, undefined, undefined, undefined]);
});
This would allow applications using stacktrace.js to continue working as well as possible if a situation like this comes up.
Hi there, first off thanks for an incredible useful collection of modules! 👍
I would expect StackFrame.functionName
to be consistent across browsers.
The parsed stack from two different browsers (e.g. Safari 11 vs. Edge 14) which originated in the top level of a <script>
tag, yields two distinct strings for StackFrame.functionName
:
"Global code"
(Safari 11) vs "global code"
(Edge 14)
I notice that there are test cases for both versions of this string:
So I wonder if this is intentional?
Personally I would like the library to normalize this string such that stacktraces are more consistent between browsers but I want to know if it is intentionally like this.
If you agree that it should be normalized, I'd be happy to supply a pull request.
Cheers!
@tarr11 commented on Mon Jun 12 2017
I am using Function
to parse and eval some code in the browser. I would like to use StackTraceJS to show errors to my users in the code editor. My code is minified using Webpack/Uglify, but user code is not. User code is executed in a sandboxed iframe.
I expect that StackFrameJS should parse "anonymous" errors correctly.
StackFrameJS does not parse anonymous errors like below, nor return the correct line number.
Sample User Code (should throw an error):
My code is executed like this
let runFunction = function (p) {
let f = null;
try {
f = Function("p", code)
f(p);
} catch (error) {
StackTrace.fromError(error).then(sr => {
window.parent.postMessage({sr, type: "err"}, "*");
})
}
}
// call runFunction
runFunction(...);
The stack trace looks like this (in Chrome)
ReferenceError: hi is not defined
at eval (eval at runFunction (http://localhost:8080/packs/iframe.js:5669:21), <anonymous>:4:9)
at runFunction (http://localhost:8080/packs/iframe.js:5670:17)
at e.Sketch.sketch.attachFunction (http://localhost:8080/packs/iframe.js:5722:17)
at e.Sketch.attach (eval at webpackJsonp.679.module.exports (http://localhost:8080/packs/iframe.js:11868:8), <anonymous>:43:267)
at Ir (eval at webpackJsonp.679.module.exports (http://localhost:8080/packs/iframe.js:11868:8), <anonymous>:1417:89)
at eval (eval at webpackJsonp.679.module.exports (http://localhost:8080/packs/iframe.js:11868:8), <anonymous>:1415:106)"
The parsed stack trace looks like this (first line)
I am trying to use StackTrace to parse and show JS errors to a user in a browser editor (Monaco)
Suggest improving the parser to handle nested / anonymous stack traces
@eriwen commented on Sat Aug 12 2017
Thanks for the issue. Error parsing is done in error-stack-parser
, so I'm moving the issue to that project.
Show the stack trace
error-stack-parser.js:31 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'parseV8OrIE')
at ErrorStackParser$$parse (error-stack-parser.js:31:1)
at StatusPageErrorBoundary.render (StatusPageProvider.tsx:24:1)
at finishClassComponent (react-dom.development.js:17485:1)
at updateClassComponent (react-dom.development.js:17435:1)
at beginWork (react-dom.development.js:19073:1)
at HTMLUnknownElement.callCallback (react-dom.development.js:3945:1)
at eval (index.js:1:1)
at Object.with (index.js:1:1)
at HTMLUnknownElement.r (index.js:1:1)
at Object.invokeGuardedCallbackDev (react-dom.development.js:3994:1)
const frame = parse(new Error('BOOM'));
Just want to read the error in a parsed format.
None
Please edit this content to see the full content. I pasted it directly from the chrome 42 debug window.
"TypeError: Line Number must be a Number↵ at Object.StackFrame.setLineNumber (http://localhost:9001/bower_components/exceptionless/dist/exceptionless.js:1027:23)↵ at Object.StackFrame (http://localhost:9001/bower_components/exceptionless/dist/exceptionless.js:986:18)↵ at Object.<anonymous> (http://localhost:9001/bower_components/exceptionless/dist/exceptionless.js:1111:24)↵ at Array.map (native)↵ at Object.ErrorStackParser$$parseV8OrIE [as parseV8OrIE] (http://localhost:9001/bower_components/exceptionless/dist/exceptionless.js:1107:53)↵ at Object.ErrorStackParser$$parse [as parse] (http://localhost:9001/bower_components/exceptionless/dist/exceptionless.js:1081:29)↵ at Object.<anonymous> (http://localhost:9001/bower_components/exceptionless/dist/exceptionless.js:1529:52)↵ at lib$es6$promise$$internal$$initializePromise (http://localhost:9001/bower_components/exceptionless/dist/exceptionless.js:366:9)↵ at new lib$es6$promise$promise$$Promise (http://localhost:9001/bower_components/exceptionless/dist/exceptionless.js:657:9)↵ at Object.StackTrace$$fromError [as fromError] (http://localhost:9001/bower_components/exceptionless/dist/exceptionless.js:1528:20)↵ at WebErrorParser.parse (http://localhost:9001/bower_components/exceptionless/dist/exceptionless.js:2890:27)↵ at ErrorPlugin.run (http://localhost:9001/bower_components/exceptionless/dist/exceptionless.js:2477:23)↵ at http://localhost:9001/bower_components/exceptionless/dist/exceptionless.js:1742:31"
Here is the exceptions stack:
"Error: [$injector:modulerr] Failed to instantiate module app due to:↵Error: [$injector:modulerr] Failed to instantiate module exceptionless due to:↵Error: [$injector:unpr] Unknown provider: ExceptionlessClient↵http://errors.angularjs.org/1.3.15/$injector/unpr?p0=ExceptionlessClient↵ at REGEX_STRING_REGEXP (http://localhost:9001/bower_components/angular/angular.js:63:12)↵ at http://localhost:9001/bower_components/angular/angular.js:4015:19↵ at getService (http://localhost:9001/bower_components/angular/angular.js:4162:39)↵ at Object.invoke (http://localhost:9001/bower_components/angular/angular.js:4194:13)↵ at runInvokeQueue (http://localhost:9001/bower_components/angular/angular.js:4109:35)↵ at http://localhost:9001/bower_components/angular/angular.js:4118:11↵ at forEach (http://localhost:9001/bower_components/angular/angular.js:323:20)↵ at loadModules (http://localhost:9001/bower_components/angular/angular.js:4099:5)↵ at http://localhost:9001/bower_components/angular/angular.js:4116:40↵ at forEach (http://localhost:9001/bower_components/angular/angular.js:323:20)↵ at loadModules (http://localhost:9001/bower_components/angular/angular.js:4099:5)↵ at createInjector (http://localhost:9001/bower_components/angular/angular.js:4025:11)↵ at doBootstrap (http://localhost:9001/bower_components/angular/angular.js:1452:20)↵ at bootstrap (http://localhost:9001/bower_components/angular/angular.js:1473:12)↵ at angularInit (http://localhost:9001/bower_components/angular/angular.js:1367:5)↵ at HTMLDocument.<anonymous> (http://localhost:9001/bower_components/angular/angular.js:26304:5)↵ at n.Callbacks.j (http://code.jquery.com/jquery-2.1.3.min.js:2:26911)↵ at Object.n.Callbacks.k.fireWith [as resolveWith] (http://code.jquery.com/jquery-2.1.3.min.js:2:27724)↵ at Function.n.extend.ready (http://code.jquery.com/jquery-2.1.3.min.js:2:29518)↵ at HTMLDocument.I (http://code.jquery.com/jquery-2.1.3.min.js:2:29709)↵http://errors.angularjs.org/1.3.15/$injector/modulerr?p0=exceptionless&p1=Error%3A%20%5B%24injector%3Aunpr%5D%20Unknown%20provider%3A%20ExceptionlessClient%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.3.15%2F%24injector%2Funpr%3Fp0%3DExceptionlessClient%0A%20%20%20%20at%20REGEX_STRING_REGEXP%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A63%3A12)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4015%3A19%0A%20%20%20%20at%20getService%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4162%3A39)%0A%20%20%20%20at%20Object.invoke%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4194%3A13)%0A%20%20%20%20at%20runInvokeQueue%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4109%3A35)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4118%3A11%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A323%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4099%3A5)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4116%3A40%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A323%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4099%3A5)%0A%20%20%20%20at%20createInjector%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4025%3A11)%0A%20%20%20%20at%20doBootstrap%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A1452%3A20)%0A%20%20%20%20at%20bootstrap%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A1473%3A12)%0A%20%20%20%20at%20angularInit%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A1367%3A5)%0A%20%20%20%20at%20HTMLDocument.%3Canonymous%3E%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A26304%3A5)%0A%20%20%20%20at%20n.Callbacks.j%20(http%3A%2F%2Fcode.jquery.com%2Fjquery-2.1.3.min.js%3A2%3A26911)%0A%20%20%20%20at%20Object.n.Callbacks.k.fireWith%20%5Bas%20resolveWith%5D%20(http%3A%2F%2Fcode.jquery.com%2Fjquery-2.1.3.min.js%3A2%3A27724)%0A%20%20%20%20at%20Function.n.extend.ready%20(http%3A%2F%2Fcode.jquery.com%2Fjquery-2.1.3.min.js%3A2%3A29518)%0A%20%20%20%20at%20HTMLDocument.I%20(http%3A%2F%2Fcode.jquery.com%2Fjquery-2.1.3.min.js%3A2%3A29709)↵ at REGEX_STRING_REGEXP (http://localhost:9001/bower_components/angular/angular.js:63:12)↵ at http://localhost:9001/bower_components/angular/angular.js:4138:15↵ at forEach (http://localhost:9001/bower_components/angular/angular.js:323:20)↵ at loadModules (http://localhost:9001/bower_components/angular/angular.js:4099:5)↵ at http://localhost:9001/bower_components/angular/angular.js:4116:40↵ at forEach (http://localhost:9001/bower_components/angular/angular.js:323:20)↵ at loadModules (http://localhost:9001/bower_components/angular/angular.js:4099:5)↵ at createInjector (http://localhost:9001/bower_components/angular/angular.js:4025:11)↵ at doBootstrap (http://localhost:9001/bower_components/angular/angular.js:1452:20)↵ at bootstrap (http://localhost:9001/bower_components/angular/angular.js:1473:12)↵ at angularInit (http://localhost:9001/bower_components/angular/angular.js:1367:5)↵ at HTMLDocument.<anonymous> (http://localhost:9001/bower_components/angular/angular.js:26304:5)↵ at n.Callbacks.j (http://code.jquery.com/jquery-2.1.3.min.js:2:26911)↵ at Object.n.Callbacks.k.fireWith [as resolveWith] (http://code.jquery.com/jquery-2.1.3.min.js:2:27724)↵ at Function.n.extend.ready (http://code.jquery.com/jquery-2.1.3.min.js:2:29518)↵ at HTMLDocument.I (http://code.jquery.com/jquery-2.1.3.min.js:2:29709)↵http://errors.angularjs.org/1.3.15/$injector/modulerr?p0=app&p1=Error%3A%20%5B%24injector%3Amodulerr%5D%20Failed%20to%20instantiate%20module%20exceptionless%20due%20to%3A%0AError%3A%20%5B%24injector%3Aunpr%5D%20Unknown%20provider%3A%20ExceptionlessClient%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.3.15%2F%24injector%2Funpr%3Fp0%3DExceptionlessClient%0A%20%20%20%20at%20REGEX_STRING_REGEXP%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A63%3A12)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4015%3A19%0A%20%20%20%20at%20getService%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4162%3A39)%0A%20%20%20%20at%20Object.invoke%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4194%3A13)%0A%20%20%20%20at%20runInvokeQueue%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4109%3A35)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4118%3A11%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A323%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4099%3A5)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4116%3A40%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A323%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4099%3A5)%0A%20%20%20%20at%20createInjector%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4025%3A11)%0A%20%20%20%20at%20doBootstrap%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A1452%3A20)%0A%20%20%20%20at%20bootstrap%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A1473%3A12)%0A%20%20%20%20at%20angularInit%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A1367%3A5)%0A%20%20%20%20at%20HTMLDocument.%3Canonymous%3E%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A26304%3A5)%0A%20%20%20%20at%20n.Callbacks.j%20(http%3A%2F%2Fcode.jquery.com%2Fjquery-2.1.3.min.js%3A2%3A26911)%0A%20%20%20%20at%20Object.n.Callbacks.k.fireWith%20%5Bas%20resolveWith%5D%20(http%3A%2F%2Fcode.jquery.com%2Fjquery-2.1.3.min.js%3A2%3A27724)%0A%20%20%20%20at%20Function.n.extend.ready%20(http%3A%2F%2Fcode.jquery.com%2Fjquery-2.1.3.min.js%3A2%3A29518)%0A%20%20%20%20at%20HTMLDocument.I%20(http%3A%2F%2Fcode.jquery.com%2Fjquery-2.1.3.min.js%3A2%3A29709)%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.3.15%2F%24injector%2Fmodulerr%3Fp0%3Dexceptionless%26p1%3DError%253A%2520%255B%2524injector%253Aunpr%255D%2520Unknown%2520provider%253A%2520ExceptionlessClient%250Ahttp%253A%252F%252Ferrors.angularjs.org%252F1.3.15%252F%2524injector%252Funpr%253Fp0%253DExceptionlessClient%250A%2520%2520%2520%2520at%2520REGEX_STRING_REGEXP%2520(http%253A%252F%252Flocalhost%253A9001%252Fbower_components%252Fangular%252Fangular.js%253A63%253A12)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A9001%252Fbower_components%252Fangular%252Fangular.js%253A4015%253A19%250A%2520%2520%2520%2520at%2520getService%2520(http%253A%252F%252Flocalhost%253A9001%252Fbower_components%252Fangular%252Fangular.js%253A4162%253A39)%250A%2520%2520%2520%2520at%2520Object.invoke%2520(http%253A%252F%252Flocalhost%253A9001%252Fbower_components%252Fangular%252Fangular.js%253A4194%253A13)%250A%2520%2520%2520%2520at%2520runInvokeQueue%2520(http%253A%252F%252Flocalhost%253A9001%252Fbower_components%252Fangular%252Fangular.js%253A4109%253A35)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A9001%252Fbower_components%252Fangular%252Fangular.js%253A4118%253A11%250A%2520%2520%2520%2520at%2520forEach%2520(http%253A%252F%252Flocalhost%253A9001%252Fbower_components%252Fangular%252Fangular.js%253A323%253A20)%250A%2520%2520%2520%2520at%2520loadModules%2520(http%253A%252F%252Flocalhost%253A9001%252Fbower_components%252Fangular%252Fangular.js%253A4099%253A5)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A9001%252Fbower_components%252Fangular%252Fangular.js%253A4116%253A40%250A%2520%2520%2520%2520at%2520forEach%2520(http%253A%252F%252Flocalhost%253A9001%252Fbower_components%252Fangular%252Fangular.js%253A323%253A20)%250A%2520%2520%2520%2520at%2520loadModules%2520(http%253A%252F%252Flocalhost%253A9001%252Fbower_components%252Fangular%252Fangular.js%253A4099%253A5)%250A%2520%2520%2520%2520at%2520createInjector%2520(http%253A%252F%252Flocalhost%253A9001%252Fbower_components%252Fangular%252Fangular.js%253A4025%253A11)%250A%2520%2520%2520%2520at%2520doBootstrap%2520(http%253A%252F%252Flocalhost%253A9001%252Fbower_components%252Fangular%252Fangular.js%253A1452%253A20)%250A%2520%2520%2520%2520at%2520bootstrap%2520(http%253A%252F%252Flocalhost%253A9001%252Fbower_components%252Fangular%252Fangular.js%253A1473%253A12)%250A%2520%2520%2520%2520at%2520angularInit%2520(http%253A%252F%252Flocalhost%253A9001%252Fbower_components%252Fangular%252Fangular.js%253A1367%253A5)%250A%2520%2520%2520%2520at%2520HTMLDocument.%253Canonymous%253E%2520(http%253A%252F%252Flocalhost%253A9001%252Fbower_components%252Fangular%252Fangular.js%253A26304%253A5)%250A%2520%2520%2520%2520at%2520n.Callbacks.j%2520(http%253A%252F%252Fcode.jquery.com%252Fjquery-2.1.3.min.js%253A2%253A26911)%250A%2520%2520%2520%2520at%2520Object.n.Callbacks.k.fireWith%2520%255Bas%2520resolveWith%255D%2520(http%253A%252F%252Fcode.jquery.com%252Fjquery-2.1.3.min.js%253A2%253A27724)%250A%2520%2520%2520%2520at%2520Function.n.extend.ready%2520(http%253A%252F%252Fcode.jquery.com%252Fjquery-2.1.3.min.js%253A2%253A29518)%250A%2520%2520%2520%2520at%2520HTMLDocument.I%2520(http%253A%252F%252Fcode.jquery.com%252Fjquery-2.1.3.min.js%253A2%253A29709)%0A%20%20%20%20at%20REGEX_STRING_REGEXP%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A63%3A12)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4138%3A15%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A323%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4099%3A5)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4116%3A40%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A323%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4099%3A5)%0A%20%20%20%20at%20createInjector%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4025%3A11)%0A%20%20%20%20at%20doBootstrap%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A1452%3A20)%0A%20%20%20%20at%20bootstrap%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A1473%3A12)%0A%20%20%20%20at%20angularInit%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A1367%3A5)%0A%20%20%20%20at%20HTMLDocument.%3Canonymous%3E%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A26304%3A5)%0A%20%20%20%20at%20n.Callbacks.j%20(http%3A%2F%2Fcode.jquery.com%2Fjquery-2.1.3.min.js%3A2%3A26911)%0A%20%20%20%20at%20Object.n.Callbacks.k.fireWith%20%5Bas%20resolveWith%5D%20(http%3A%2F%2Fcode.jquery.com%2Fjquery-2.1.3.min.js%3A2%3A27724)%0A%20%20%20%20at%20Function.n.extend.ready%20(http%3A%2F%2Fcode.jquery.com%2Fjquery-2.1.3.min.js%3A2%3A29518)%0A%20%20%20%20at%20HTMLDocument.I%20(http%3A%2F%2Fcode.jquery.com%2Fjquery-2.1.3.min.js%3A2%3A29709)↵ at REGEX_STRING_REGEXP (http://localhost:9001/bower_components/angular/angular.js:63:12)↵ at http://localhost:9001/bower_components/angular/angular.js:4138:15↵ at forEach (http://localhost:9001/bower_components/angular/angular.js:323:20)↵ at loadModules (http://localhost:9001/bower_components/angular/angular.js:4099:5)↵ at createInjector (http://localhost:9001/bower_components/angular/angular.js:4025:11)↵ at doBootstrap (http://localhost:9001/bower_components/angular/angular.js:1452:20)↵ at bootstrap (http://localhost:9001/bower_components/angular/angular.js:1473:12)↵ at angularInit (http://localhost:9001/bower_components/angular/angular.js:1367:5)↵ at HTMLDocument.<anonymous> (http://localhost:9001/bower_components/angular/angular.js:26304:5)↵ at n.Callbacks.j (http://code.jquery.com/jquery-2.1.3.min.js:2:26911)↵ at Object.n.Callbacks.k.fireWith [as resolveWith] (http://code.jquery.com/jquery-2.1.3.min.js:2:27724)↵ at Function.n.extend.ready (http://code.jquery.com/jquery-2.1.3.min.js:2:29518)↵ at HTMLDocument.I (http://code.jquery.com/jquery-2.1.3.min.js:2:29709)"
Here is the exceptions message:
"[$injector:modulerr] Failed to instantiate module app due to:↵Error: [$injector:modulerr] Failed to instantiate module exceptionless due to:↵Error: [$injector:unpr] Unknown provider: ExceptionlessClient↵http://errors.angularjs.org/1.3.15/$injector/unpr?p0=ExceptionlessClient↵ at REGEX_STRING_REGEXP (http://localhost:9001/bower_components/angular/angular.js:63:12)↵ at http://localhost:9001/bower_components/angular/angular.js:4015:19↵ at getService (http://localhost:9001/bower_components/angular/angular.js:4162:39)↵ at Object.invoke (http://localhost:9001/bower_components/angular/angular.js:4194:13)↵ at runInvokeQueue (http://localhost:9001/bower_components/angular/angular.js:4109:35)↵ at http://localhost:9001/bower_components/angular/angular.js:4118:11↵ at forEach (http://localhost:9001/bower_components/angular/angular.js:323:20)↵ at loadModules (http://localhost:9001/bower_components/angular/angular.js:4099:5)↵ at http://localhost:9001/bower_components/angular/angular.js:4116:40↵ at forEach (http://localhost:9001/bower_components/angular/angular.js:323:20)↵ at loadModules (http://localhost:9001/bower_components/angular/angular.js:4099:5)↵ at createInjector (http://localhost:9001/bower_components/angular/angular.js:4025:11)↵ at doBootstrap (http://localhost:9001/bower_components/angular/angular.js:1452:20)↵ at bootstrap (http://localhost:9001/bower_components/angular/angular.js:1473:12)↵ at angularInit (http://localhost:9001/bower_components/angular/angular.js:1367:5)↵ at HTMLDocument.<anonymous> (http://localhost:9001/bower_components/angular/angular.js:26304:5)↵ at n.Callbacks.j (http://code.jquery.com/jquery-2.1.3.min.js:2:26911)↵ at Object.n.Callbacks.k.fireWith [as resolveWith] (http://code.jquery.com/jquery-2.1.3.min.js:2:27724)↵ at Function.n.extend.ready (http://code.jquery.com/jquery-2.1.3.min.js:2:29518)↵ at HTMLDocument.I (http://code.jquery.com/jquery-2.1.3.min.js:2:29709)↵http://errors.angularjs.org/1.3.15/$injector/modulerr?p0=exceptionless&p1=Error%3A%20%5B%24injector%3Aunpr%5D%20Unknown%20provider%3A%20ExceptionlessClient%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.3.15%2F%24injector%2Funpr%3Fp0%3DExceptionlessClient%0A%20%20%20%20at%20REGEX_STRING_REGEXP%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A63%3A12)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4015%3A19%0A%20%20%20%20at%20getService%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4162%3A39)%0A%20%20%20%20at%20Object.invoke%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4194%3A13)%0A%20%20%20%20at%20runInvokeQueue%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4109%3A35)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4118%3A11%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A323%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4099%3A5)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4116%3A40%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A323%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4099%3A5)%0A%20%20%20%20at%20createInjector%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4025%3A11)%0A%20%20%20%20at%20doBootstrap%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A1452%3A20)%0A%20%20%20%20at%20bootstrap%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A1473%3A12)%0A%20%20%20%20at%20angularInit%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A1367%3A5)%0A%20%20%20%20at%20HTMLDocument.%3Canonymous%3E%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A26304%3A5)%0A%20%20%20%20at%20n.Callbacks.j%20(http%3A%2F%2Fcode.jquery.com%2Fjquery-2.1.3.min.js%3A2%3A26911)%0A%20%20%20%20at%20Object.n.Callbacks.k.fireWith%20%5Bas%20resolveWith%5D%20(http%3A%2F%2Fcode.jquery.com%2Fjquery-2.1.3.min.js%3A2%3A27724)%0A%20%20%20%20at%20Function.n.extend.ready%20(http%3A%2F%2Fcode.jquery.com%2Fjquery-2.1.3.min.js%3A2%3A29518)%0A%20%20%20%20at%20HTMLDocument.I%20(http%3A%2F%2Fcode.jquery.com%2Fjquery-2.1.3.min.js%3A2%3A29709)↵ at REGEX_STRING_REGEXP (http://localhost:9001/bower_components/angular/angular.js:63:12)↵ at http://localhost:9001/bower_components/angular/angular.js:4138:15↵ at forEach (http://localhost:9001/bower_components/angular/angular.js:323:20)↵ at loadModules (http://localhost:9001/bower_components/angular/angular.js:4099:5)↵ at http://localhost:9001/bower_components/angular/angular.js:4116:40↵ at forEach (http://localhost:9001/bower_components/angular/angular.js:323:20)↵ at loadModules (http://localhost:9001/bower_components/angular/angular.js:4099:5)↵ at createInjector (http://localhost:9001/bower_components/angular/angular.js:4025:11)↵ at doBootstrap (http://localhost:9001/bower_components/angular/angular.js:1452:20)↵ at bootstrap (http://localhost:9001/bower_components/angular/angular.js:1473:12)↵ at angularInit (http://localhost:9001/bower_components/angular/angular.js:1367:5)↵ at HTMLDocument.<anonymous> (http://localhost:9001/bower_components/angular/angular.js:26304:5)↵ at n.Callbacks.j (http://code.jquery.com/jquery-2.1.3.min.js:2:26911)↵ at Object.n.Callbacks.k.fireWith [as resolveWith] (http://code.jquery.com/jquery-2.1.3.min.js:2:27724)↵ at Function.n.extend.ready (http://code.jquery.com/jquery-2.1.3.min.js:2:29518)↵ at HTMLDocument.I (http://code.jquery.com/jquery-2.1.3.min.js:2:29709)↵http://errors.angularjs.org/1.3.15/$injector/modulerr?p0=app&p1=Error%3A%20%5B%24injector%3Amodulerr%5D%20Failed%20to%20instantiate%20module%20exceptionless%20due%20to%3A%0AError%3A%20%5B%24injector%3Aunpr%5D%20Unknown%20provider%3A%20ExceptionlessClient%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.3.15%2F%24injector%2Funpr%3Fp0%3DExceptionlessClient%0A%20%20%20%20at%20REGEX_STRING_REGEXP%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A63%3A12)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4015%3A19%0A%20%20%20%20at%20getService%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4162%3A39)%0A%20%20%20%20at%20Object.invoke%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4194%3A13)%0A%20%20%20%20at%20runInvokeQueue%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4109%3A35)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4118%3A11%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A323%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4099%3A5)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4116%3A40%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A323%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4099%3A5)%0A%20%20%20%20at%20createInjector%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4025%3A11)%0A%20%20%20%20at%20doBootstrap%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A1452%3A20)%0A%20%20%20%20at%20bootstrap%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A1473%3A12)%0A%20%20%20%20at%20angularInit%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A1367%3A5)%0A%20%20%20%20at%20HTMLDocument.%3Canonymous%3E%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A26304%3A5)%0A%20%20%20%20at%20n.Callbacks.j%20(http%3A%2F%2Fcode.jquery.com%2Fjquery-2.1.3.min.js%3A2%3A26911)%0A%20%20%20%20at%20Object.n.Callbacks.k.fireWith%20%5Bas%20resolveWith%5D%20(http%3A%2F%2Fcode.jquery.com%2Fjquery-2.1.3.min.js%3A2%3A27724)%0A%20%20%20%20at%20Function.n.extend.ready%20(http%3A%2F%2Fcode.jquery.com%2Fjquery-2.1.3.min.js%3A2%3A29518)%0A%20%20%20%20at%20HTMLDocument.I%20(http%3A%2F%2Fcode.jquery.com%2Fjquery-2.1.3.min.js%3A2%3A29709)%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.3.15%2F%24injector%2Fmodulerr%3Fp0%3Dexceptionless%26p1%3DError%253A%2520%255B%2524injector%253Aunpr%255D%2520Unknown%2520provider%253A%2520ExceptionlessClient%250Ahttp%253A%252F%252Ferrors.angularjs.org%252F1.3.15%252F%2524injector%252Funpr%253Fp0%253DExceptionlessClient%250A%2520%2520%2520%2520at%2520REGEX_STRING_REGEXP%2520(http%253A%252F%252Flocalhost%253A9001%252Fbower_components%252Fangular%252Fangular.js%253A63%253A12)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A9001%252Fbower_components%252Fangular%252Fangular.js%253A4015%253A19%250A%2520%2520%2520%2520at%2520getService%2520(http%253A%252F%252Flocalhost%253A9001%252Fbower_components%252Fangular%252Fangular.js%253A4162%253A39)%250A%2520%2520%2520%2520at%2520Object.invoke%2520(http%253A%252F%252Flocalhost%253A9001%252Fbower_components%252Fangular%252Fangular.js%253A4194%253A13)%250A%2520%2520%2520%2520at%2520runInvokeQueue%2520(http%253A%252F%252Flocalhost%253A9001%252Fbower_components%252Fangular%252Fangular.js%253A4109%253A35)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A9001%252Fbower_components%252Fangular%252Fangular.js%253A4118%253A11%250A%2520%2520%2520%2520at%2520forEach%2520(http%253A%252F%252Flocalhost%253A9001%252Fbower_components%252Fangular%252Fangular.js%253A323%253A20)%250A%2520%2520%2520%2520at%2520loadModules%2520(http%253A%252F%252Flocalhost%253A9001%252Fbower_components%252Fangular%252Fangular.js%253A4099%253A5)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A9001%252Fbower_components%252Fangular%252Fangular.js%253A4116%253A40%250A%2520%2520%2520%2520at%2520forEach%2520(http%253A%252F%252Flocalhost%253A9001%252Fbower_components%252Fangular%252Fangular.js%253A323%253A20)%250A%2520%2520%2520%2520at%2520loadModules%2520(http%253A%252F%252Flocalhost%253A9001%252Fbower_components%252Fangular%252Fangular.js%253A4099%253A5)%250A%2520%2520%2520%2520at%2520createInjector%2520(http%253A%252F%252Flocalhost%253A9001%252Fbower_components%252Fangular%252Fangular.js%253A4025%253A11)%250A%2520%2520%2520%2520at%2520doBootstrap%2520(http%253A%252F%252Flocalhost%253A9001%252Fbower_components%252Fangular%252Fangular.js%253A1452%253A20)%250A%2520%2520%2520%2520at%2520bootstrap%2520(http%253A%252F%252Flocalhost%253A9001%252Fbower_components%252Fangular%252Fangular.js%253A1473%253A12)%250A%2520%2520%2520%2520at%2520angularInit%2520(http%253A%252F%252Flocalhost%253A9001%252Fbower_components%252Fangular%252Fangular.js%253A1367%253A5)%250A%2520%2520%2520%2520at%2520HTMLDocument.%253Canonymous%253E%2520(http%253A%252F%252Flocalhost%253A9001%252Fbower_components%252Fangular%252Fangular.js%253A26304%253A5)%250A%2520%2520%2520%2520at%2520n.Callbacks.j%2520(http%253A%252F%252Fcode.jquery.com%252Fjquery-2.1.3.min.js%253A2%253A26911)%250A%2520%2520%2520%2520at%2520Object.n.Callbacks.k.fireWith%2520%255Bas%2520resolveWith%255D%2520(http%253A%252F%252Fcode.jquery.com%252Fjquery-2.1.3.min.js%253A2%253A27724)%250A%2520%2520%2520%2520at%2520Function.n.extend.ready%2520(http%253A%252F%252Fcode.jquery.com%252Fjquery-2.1.3.min.js%253A2%253A29518)%250A%2520%2520%2520%2520at%2520HTMLDocument.I%2520(http%253A%252F%252Fcode.jquery.com%252Fjquery-2.1.3.min.js%253A2%253A29709)%0A%20%20%20%20at%20REGEX_STRING_REGEXP%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A63%3A12)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4138%3A15%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A323%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4099%3A5)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4116%3A40%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A323%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4099%3A5)%0A%20%20%20%20at%20createInjector%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A4025%3A11)%0A%20%20%20%20at%20doBootstrap%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A1452%3A20)%0A%20%20%20%20at%20bootstrap%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A1473%3A12)%0A%20%20%20%20at%20angularInit%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A1367%3A5)%0A%20%20%20%20at%20HTMLDocument.%3Canonymous%3E%20(http%3A%2F%2Flocalhost%3A9001%2Fbower_components%2Fangular%2Fangular.js%3A26304%3A5)%0A%20%20%20%20at%20n.Callbacks.j%20(http%3A%2F%2Fcode.jquery.com%2Fjquery-2.1.3.min.js%3A2%3A26911)%0A%20%20%20%20at%20Object.n.Callbacks.k.fireWith%20%5Bas%20resolveWith%5D%20(http%3A%2F%2Fcode.jquery.com%2Fjquery-2.1.3.min.js%3A2%3A27724)%0A%20%20%20%20at%20Function.n.extend.ready%20(http%3A%2F%2Fcode.jquery.com%2Fjquery-2.1.3.min.js%3A2%3A29518)%0A%20%20%20%20at%20HTMLDocument.I%20(http%3A%2F%2Fcode.jquery.com%2Fjquery-2.1.3.min.js%3A2%3A29709)"
ERROR TypeError: StackFrame is not a constructor
10:58:23 TypeError: StackFrame is not a constructor
10:58:23 at Object. (/******/node_modules/error-stack-parser/error-stack-parser.js:76:24)
what's wrong? the new version has changed the usage?
We need captured errors and tests for IE 11.
In Node.JS (v7+), the fileName
and functionName
properties result in incorrect values when parsing a callsite that has spaces in the filename.
Error: The file could not be uploaded to the element `#file-image` because it does not exist on the page
at setFavicon (/Users/andyv/MindTouch/QA-Automated-Testsuite/tests_active/testrun/Control Panel/Branding/customSiteFavicon.js:18:24)
[
{
"columnNumber": 24,
"lineNumber": 18,
"fileName": "/Users/andyv/MindTouch/QA-Automated-Testsuite/tests_active/testrun/Control Panel/Branding/customSiteFavicon.js",
"functionName": "setFavicon",
"source": " at setFavicon (/Users/andyv/MindTouch/QA-Automated-Testsuite/tests_active/testrun/Control Panel/Branding/customSiteFavicon.js:18:24)"
}
]
[
{
"columnNumber": 24,
"lineNumber": 18,
"fileName": "Panel/Branding/customSiteFavicon.js",
"functionName": "setFavicon (/Users/andyv/MindTouch/QA-Automated-Testsuite/tests_active/testrun/Control",
"source": " at setFavicon (/Users/andyv/MindTouch/QA-Automated-Testsuite/tests_active/testrun/Control Panel/Branding/customSiteFavicon.js:18:24)"
}
]
error-stack-parser.d.ts is not included in package.json (see https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) and does not seem to be included at all in npm.
the https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/error-stack-parser/index.d.ts version is stale since d9eb56a, and it'd be great if the updated definitions were bundled with the standard distribution. thanks!
Need captured errors and tests for Safari 8
I'm using linux and the packaged Opera is v12.16 and I noticed that I am not getting any column numbers. I looked at the Error object and there is stack
and stacktrace
property. The stack
property, which you seem to be using for this version, does not have the column numbers but the stacktrace
does. Would it be possible to parse the stacktrace
to get this information? It also reports everything twice.
[
{
"functionName": "CustomError",
"fileName": "http://fiddle.jshell.net/2k5x5dj8/157/show/",
"lineNumber": 303,
"source": "CustomError([arguments not available])@http://fiddle.jshell.net/2k5x5dj8/157/show/:303"
},
{
"functionName": "<anonymous function: Y.prototype.x>",
"fileName": "http://fiddle.jshell.net/2k5x5dj8/157/show/",
"lineNumber": 445,
"source": "<anonymous function: Y.prototype.x>([arguments not available])@http://fiddle.jshell.net/2k5x5dj8/157/show/:445"
},
{
"functionName": "<anonymous function: window.onload>",
"fileName": "http://fiddle.jshell.net/2k5x5dj8/157/show/",
"lineNumber": 451,
"source": "<anonymous function: window.onload>([arguments not available])@http://fiddle.jshell.net/2k5x5dj8/157/show/:451"
},
{
"functionName": "CustomError",
"fileName": "http://fiddle.jshell.net/2k5x5dj8/157/show/",
"lineNumber": 303,
"source": "CustomError([arguments not available])@http://fiddle.jshell.net/2k5x5dj8/157/show/:303"
},
{
"functionName": "<anonymous function: Y.prototype.x>",
"fileName": "http://fiddle.jshell.net/2k5x5dj8/157/show/",
"lineNumber": 445,
"source": "<anonymous function: Y.prototype.x>([arguments not available])@http://fiddle.jshell.net/2k5x5dj8/157/show/:445"
},
{
"functionName": "<anonymous function: window.onload>",
"fileName": "http://fiddle.jshell.net/2k5x5dj8/157/show/",
"lineNumber": 451,
"source": "<anonymous function: window.onload>([arguments not available])@http://fiddle.jshell.net/2k5x5dj8/157/show/:451"
}
]
Consider attaching a function to the Error prototype for convenience.
I have an array of errors which I want to convert with error-stack-parser.
What I did was basically this:
errors.map(ErrorStackParser.parse).forEach(console.log)
I expected to get an array of StackFrames for each error.
TypeError: Cannot read property 'parseV8OrIE' of undefined
at ErrorStackParser$$parse (error-stack-parser.js:31:29)
at Array.map (<anonymous>)
at Object.<anonymous> (test.js:17:8)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Function.Module.runMain (module.js:676:10)
at startup (bootstrap_node.js:187:16)
const ErrorStackParser = require('error-stack-parser');
const errors = [new Error()];
errors.map(ErrorStackParser.parse).forEach(console.log);
This works:
errors.forEach((error) => console.log(ErrorStackParser.parse(error)))
And surprisingly this works too:
errors.map((error) => ErrorStackParser.parse(error)).forEach(console.log)
error-stack-parser 2.0.1
Node.js 8.9.0
Windows 10
After upgrading the version to 2.1.3, we get this error.
ERROR: ErrorStackParser.parse is not a function
Add tests using CapturedExceptions.OPERA_1215
and ensure they pass.
I'm on windows 8.1, node 0.10.29. Running npm from a fresh clone of the repo I get some errors on the console. Is this project's npm install linux-specific?
The console output:
D:\billysFile\code\javascript\nodejs\modules\error-stack-parser>npm install
npm WARN deprecated [email protected]: You can now install this using [email protected] node_modules/uglify-js
npm WARN deprecated ├── [email protected] ([email protected])
npm WARN deprecated └── [email protected] ([email protected])
npm WARN optional dep failed, continuing [email protected]
/
> [email protected] install D:\billysFile\code\javascript\nodejs\modules\error-stack-parser\node_modules\karma-phantomjs-launcher\node_module
s\phantomjs
> node install.js
Downloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-windows.zip
Saving to C:\Users\FRESHE~1\AppData\Local\Temp\phantomjs\phantomjs-1.9.8-windows.zip
Receiving...
/ [=======================================-] 97% 0.0s/
Received 7292K total.
Extracting zip contents
Removing D:\billysFile\code\javascript\nodejs\modules\error-stack-parser\node_modules\karma-phantomjs-launcher\node_modules\phantomjs\lib\ph
antom
Copying extracted folder C:\Users\FRESHE~1\AppData\Local\Temp\phantomjs\phantomjs-1.9.8-windows.zip-extract-1424150658488\phantomjs-1.9.8-wi
ndows -> D:\billysFile\code\javascript\nodejs\modules\error-stack-parser\node_modules\karma-phantomjs-launcher\node_modules\phantomjs\lib\ph
antom
Writing location.js file
Phantom installation failed { [Error: EPERM, operation not permitted 'D:\billysFile\code\javascript\nodejs\modules\error-stack-parser\node_m
odules\karma-phantomjs-launcher\node_modules\phantomjs\lib\phantom\phantomjs.exe']
errno: 50,
code: 'EPERM',
path: 'D:\\billysFile\\code\\javascript\\nodejs\\modules\\error-stack-parser\\node_modules\\karma-phantomjs-launcher\\node_modules\\phanto
mjs\\lib\\phantom\\phantomjs.exe',
syscall: 'chmod' } Error: EPERM, operation not permitted 'D:\billysFile\code\javascript\nodejs\modules\error-stack-parser\node_modules\kar
ma-phantomjs-launcher\node_modules\phantomjs\lib\phantom\phantomjs.exe'
at Object.fs.chmodSync (evalmachine.<anonymous>:826:18)
at Object.chmodSync (D:\billysFile\code\javascript\nodejs\modules\error-stack-parser\node_modules\karma-phantomjs-launcher\node_modules\
phantomjs\node_modules\fs-extra\node_modules\graceful-fs\polyfills.js:141:17)
at Promise.validExit [as _successFn] (D:\billysFile\code\javascript\nodejs\modules\error-stack-parser\node_modules\karma-phantomjs-launc
her\node_modules\phantomjs\install.js:145:8)
at Promise._call (D:\billysFile\code\javascript\nodejs\modules\error-stack-parser\node_modules\karma-phantomjs-launcher\node_modules\pha
ntomjs\node_modules\kew\kew.js:373:13)
at Promise._withInput (D:\billysFile\code\javascript\nodejs\modules\error-stack-parser\node_modules\karma-phantomjs-launcher\node_module
s\phantomjs\node_modules\kew\kew.js:333:25)
at Promise.resolve (D:\billysFile\code\javascript\nodejs\modules\error-stack-parser\node_modules\karma-phantomjs-launcher\node_modules\p
hantomjs\node_modules\kew\kew.js:105:27)
at resolver (D:\billysFile\code\javascript\nodejs\modules\error-stack-parser\node_modules\karma-phantomjs-launcher\node_modules\phantomj
s\node_modules\kew\kew.js:409:17)
at CB (D:\billysFile\code\javascript\nodejs\modules\error-stack-parser\node_modules\karma-phantomjs-launcher\node_modules\phantomjs\node
_modules\fs-extra\node_modules\rimraf\rimraf.js:68:5)
at Object.oncomplete (fs.js:107:15)
|
> [email protected] install D:\billysFile\code\javascript\nodejs\modules\error-stack-parser\node_modules\karma\node_modules\socket.io\node_modules\s
ocket.io-client\node_modules\ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
D:\billysFile\code\javascript\nodejs\modules\error-stack-parser\node_modules\karma\node_modules\socket.io\node_modules\socket.io-client\node
_modules\ws>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
\
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
bufferutil.cc
D:\billysFile\code\javascript\nodejs\modules\error-stack-parser\node_modules\karma\node_modules\socket.io\node_modules\socket.io-client\nod
e_modules\ws\node_modules\nan\nan.h(1103): warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data [D:\bil
lysFile\code\javascript\nodejs\modules\error-stack-parser\node_modules\karma\node_modules\socket.io\node_modules\socket.io-client\node_modu
les\ws\build\bufferutil.vcxproj]
D:\billysFile\code\javascript\nodejs\modules\error-stack-parser\node_modules\karma\node_modules\socket.io\node_modules\socket.io-client\nod
e_modules\ws\node_modules\nan\nan.h(1117): warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data [D:\bil
lysFile\code\javascript\nodejs\modules\error-stack-parser\node_modules\karma\node_modules\socket.io\node_modules\socket.io-client\node_modu
les\ws\build\bufferutil.vcxproj]
C:\Users\fresheneesz\.node-gyp\0.10.29\deps\v8\include\v8.h(179): warning C4506: no definition for inline function 'v8::Persistent<T> v8::P
ersistent<T>::New(v8::Handle<T>)' [D:\billysFile\code\javascript\nodejs\modules\error-stack-parser\node_modules\karma\node_modules\socket.i
o\node_modules\socket.io-client\node_modules\ws\build\bufferutil.vcxproj]
with
[
T=v8::Object
]
Creating library D:\billysFile\code\javascript\nodejs\modules\error-stack-parser\node_modules\karma\node_modules\socket.io\node_module
s\socket.io-client\node_modules\ws\build\Release\bufferutil.lib and object D:\billysFile\code\javascript\nodejs\modules\error-stack-parse
r\node_modules\karma\node_modules\socket.io\node_modules\socket.io-client\node_modules\ws\build\Release\bufferutil.exp
Generating code
Finished generating code
bufferutil.vcxproj -> D:\billysFile\code\javascript\nodejs\modules\error-stack-parser\node_modules\karma\node_modules\socket.io\node_modu
les\socket.io-client\node_modules\ws\build\Release\\bufferutil.node
validation.cc
D:\billysFile\code\javascript\nodejs\modules\error-stack-parser\node_modules\karma\node_modules\socket.io\node_modules\socket.io-client\nod
e_modules\ws\node_modules\nan\nan.h(1103): warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data [D:\bil
lysFile\code\javascript\nodejs\modules\error-stack-parser\node_modules\karma\node_modules\socket.io\node_modules\socket.io-client\node_modu
les\ws\build\validation.vcxproj]
D:\billysFile\code\javascript\nodejs\modules\error-stack-parser\node_modules\karma\node_modules\socket.io\node_modules\socket.io-client\nod
e_modules\ws\node_modules\nan\nan.h(1117): warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data [D:\bil
lysFile\code\javascript\nodejs\modules\error-stack-parser\node_modules\karma\node_modules\socket.io\node_modules\socket.io-client\node_modu
les\ws\build\validation.vcxproj]
C:\Users\fresheneesz\.node-gyp\0.10.29\deps\v8\include\v8.h(179): warning C4506: no definition for inline function 'v8::Persistent<T> v8::P
ersistent<T>::New(v8::Handle<T>)' [D:\billysFile\code\javascript\nodejs\modules\error-stack-parser\node_modules\karma\node_modules\socket.i
o\node_modules\socket.io-client\node_modules\ws\build\validation.vcxproj]
with
[
T=v8::Object
]
Creating library D:\billysFile\code\javascript\nodejs\modules\error-stack-parser\node_modules\karma\node_modules\socket.io\node_module
s\socket.io-client\node_modules\ws\build\Release\validation.lib and object D:\billysFile\code\javascript\nodejs\modules\error-stack-parse
r\node_modules\karma\node_modules\socket.io\node_modules\socket.io-client\node_modules\ws\build\Release\validation.exp
Generating code
Finished generating code
validation.vcxproj -> D:\billysFile\code\javascript\nodejs\modules\error-stack-parser\node_modules\karma\node_modules\socket.io\node_modu
les\socket.io-client\node_modules\ws\build\Release\\validation.node
npm ERR! [email protected] install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the phantomjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls phantomjs
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd D:\billysFile\code\javascript\nodejs\modules\error-stack-parser
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! D:\billysFile\code\javascript\nodejs\modules\error-stack-parser\npm-debug.log
npm ERR! not ok code 0
Hi thanks for this library. It looks great all though I've had some problems getting off the starting block with it.
I've prepared an example project which I believe should work but while parsing a stack trace from an exception it throws an error.
No exception should be thrown while parsing the stack trace in the example project.
The following exception is thrown while parsing the stack trace in the example project:
C:\projects\github\stack-trace-test\node_modules\error-stack-parser\error-stack-parser.js:31
return this.parseV8OrIE(error);
^
TypeError: Cannot read property 'parseV8OrIE' of undefined
at ErrorStackParser$$parse (C:\projects\github\stack-trace-test\node_modules\error-stack-parser\error-stack-parser.js:31:29)
at Object.<anonymous> (C:\projects\github\stack-trace-test\my test script.js:18:20)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Function.Module.runMain (module.js:684:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
I've prepared an example repository:
https://github.com/ashleydavis/stack-trace-test
Clone the repo. Or download and unpack the repo.
Use npm install
to install dependencies.
Use npm start
to run the example project.
The exception mentioned above is thrown.
I was hoping to use your stack trace parser in my project, but I've been blocked from using it by some basic problems. This is just the first issue, if we can solve this one I'll prepare an example that demonstrates the next problem.
Sorry, no idea.
I wrote some failing tests based tests I've had working for my stackinfo project. I'm blocked on using the new version of stacktrace.js until they're fixed, so I'd like to do as much as I can to get them fixed up.
Error objects to be included in captured-errors.js
CapturedExceptions.CHROME_40A = { // I'm assuming here that the numbers are the version (this is version 40)
message: "who cares",
name: "Error",
stack: "Error: who cares\n" +
" H()@http://localhost:8100/:47:25\n" +
" ProtoObjectFactory.<anonymous> (http://localhost:8001/git/frontend/test/allTestsFE.bundle.js:1459:20)\n" +
" (?)()@http://localhost:8001/git/frontend/test/allTestsFE.bundle.js:79:15\n" +
" Object.module.exports.test.TabBar.buttons.callback [as click] (http://localhost:8001/git/frontend/test/allTestsFE.bundle.js:1546:9)"
}
// note, this comes from the same code as FIREFOX_35_B
CapturedExceptions.CHROME_40B = { // I'm assuming here that the numbers are the version (this is version 40)
message: "who cares",
name: "Error",
stack: "Error\n"+
" at Object.StackTrace$$get [as get] (http://localhost:8100/generatedBuild/stackinfo.umd.js:3788:23)\n"+
" at 21.module.exports (http://localhost:8100/generatedBuild/stackinfo.umd.js:3923:38)\n"+
" at http://localhost:8100/:47:13\n"+
" at http://localhost:8100/test/moar.js:12:9\n"+
" at x (http://localhost:8100/test/moar.js:7:5)\n"+
" at moar (http://localhost:8100/test/moar.js:2:5)\n"+
" at H (http://localhost:8100/:46:9)\n"+
" at http://localhost:8100/:41:13\n"+
" at Array.forEach (native)\n"+
" at G (http://localhost:8100/:40:14)"
}
CapturedExceptions.FIREFOX_35 = { // I'm assuming here that the numbers are the version (this is version 35)
message: "whatever",
name: "Error",
stack: "ReferenceError: whatever\n" +
" (?)()@http://localhost:8100/test.web.bundle.js:75\n" +
" module.exports/req.onreadystatechange@http://localhost:8001/git/frontend/test/generated/allTestsFE.bundle.js:5943:1\n" +
" module.exports<.getSourceMapObject@http://localhost:8001/git/frontend/test/generated/allTestsFE.bundle.js:4970:10",
fileName: "http://path/to/file.js",
lineNumber: 75
};
// note, this comes from the same code as CHROME_40B
CapturedExceptions.FIREFOX_35_B = { // I'm assuming here that the numbers are the version (this is version 35)
message: "whatever",
name: "Error",
stack: "StackTrace$$get@http://localhost:8100/generatedBuild/stackinfo.umd.js:3788:23\n" +
"[21]</module.exports@http://localhost:8100/generatedBuild/stackinfo.umd.js:3923:27\n" +
"H/<@http://localhost:8100/:47:13\n" +
"gen/<@http://localhost:8100/test/moar.js:12:9\n" +
"x@http://localhost:8100/test/moar.js:7:5\n" +
"moar@http://localhost:8100/test/moar.js:2:5\n" +
"H@http://localhost:8100/:46:9\n" +
"G/<@http://localhost:8100/:41:13\n" +
"G@http://localhost:8100/:40:10\n" +
"F<[6]/<@http://localhost:8100/:34:21\n" +
"E.fn1@http://localhost:8100/:27:13\n" +
"D@http://localhost:8100/:22:9\n" +
"C@http://localhost:8100/:18:9\n" +
"B@http://localhost:8100/:14:9\n" +
"A@http://localhost:8100/:10:9\n" +
"unittest</<@http://localhost:8100/:156:13\n" +
"testGroup/runTest@http://localhost:8100/node_modules/deadunit/browserPackage/deadunit.browser.gen.umd.js:3746:17\n" +
"[18]</module.exports<.runTestGroup@http://localhost:8100/node_modules/deadunit/browserPackage/deadunit.browser.gen.umd.js:3465:9\n" +
"testGroup@http://localhost:8100/node_modules/deadunit/browserPackage/deadunit.browser.gen.umd.js:3752:9\n" +
"[19]</module.exports/UnitTester.prototype.test@http://localhost:8100/node_modules/deadunit/browserPackage/deadunit.browser.gen.umd.js:3881:17\n" +
"unittest<@http://localhost:8100/:153:9\n" +
"testGroup/runTest@http://localhost:8100/node_modules/deadunit/browserPackage/deadunit.browser.gen.umd.js:3746:17\n" +
"[18]</module.exports<.runTestGroup@http://localhost:8100/node_modules/deadunit/browserPackage/deadunit.browser.gen.umd.js:3465:9\n" +
"testGroup@http://localhost:8100/node_modules/deadunit/browserPackage/deadunit.browser.gen.umd.js:3752:9\n" +
"[19]</module.exports/UnitTester.prototype.test@http://localhost:8100/node_modules/deadunit/browserPackage/deadunit.browser.gen.umd.js:3881:17\n" +
"runTest@http://localhost:8100/node_modules/deadunit/browserPackage/deadunit.browser.gen.umd.js:3649:13\n" +
"[19]</module.exports/UnitTest</this.init/<@http://localhost:8100/node_modules/deadunit/browserPackage/deadunit.browser.gen.umd.js:3593:17\n",
fileName: "http://localhost:8100/generatedBuild/stackinfo.umd.js",
lineNumber: 3788,
columnNumber: 22
};
CapturedExceptions.IE_11_C = {
message: "whatever",
name: "ReferenceError",
stack: "ReferenceError: whatever\n" +
" {anonymous}()@(http://localhost:8100/:47:13)\n" +
" x@http://localhost:8100/test/moar.js:7:5",
description: "whatever",
number: -2146823279
};
Specs to be added to error-stack-parser-spec.js
it('should parse V8 Error.stack entries of various types', function () {
var stackFrames = unit.parse(CapturedExceptions.CHROME_38);
expect(stackFrames).toBeTruthy();
expect(stackFrames.length).toBe(10);
expect(stackFrames[0]).toMatchStackFrame(['Object.StackTrace$$get', undefined, 'http://localhost:8100/generatedBuild/stackinfo.umd.js', 3788, 23]);
expect(stackFrames[1]).toMatchStackFrame(['21.module.exports', undefined, "http://localhost:8100/generatedBuild/stackinfo.umd.js", 3923, 38]);
expect(stackFrames[2]).toMatchStackFrame([undefined, undefined, "http://localhost:8100/", 47, 13]);
expect(stackFrames[3]).toMatchStackFrame([undefined, undefined, "http://localhost:8100/test/moar.js", 12, 9]);
expect(stackFrames[4]).toMatchStackFrame(['x', undefined, 'http://localhost:8100/test/moar.js', 7, 5]);
expect(stackFrames[5]).toMatchStackFrame(['moar', undefined, 'http://localhost:8100/test/moar.js', 2, 5]);
expect(stackFrames[6]).toMatchStackFrame(['H', undefined, 'http://localhost:8100/', 46, 9]);
expect(stackFrames[7]).toMatchStackFrame([undefined, undefined, 'http://localhost:8100/', 41, 13]);
expect(stackFrames[8]).toMatchStackFrame(['Array.forEach', undefined, undefined, undefined, undefined]);
expect(stackFrames[9]).toMatchStackFrame(['G', undefined, 'http://localhost:8100/', 40, 14]);
});
it('should parse V8 Error.stack entries of other various types', function () {
var stackFrames = unit.parse(CapturedExceptions.CHROME_37);
expect(stackFrames).toBeTruthy();
expect(stackFrames.length).toBe(4);
expect(stackFrames[0]).toMatchStackFrame(['H', undefined, 'http://localhost:8100/', 47, 25]);
expect(stackFrames[1]).toMatchStackFrame(['ProtoObjectFactory.<anonymous>', undefined, "http://localhost:8001/git/frontend/test/allTestsFE.bundle.js", 1459, 20]);
expect(stackFrames[2]).toMatchStackFrame([undefined, undefined, "http://localhost:8001/git/frontend/test/allTestsFE.bundle.js", 79, 15]);
expect(stackFrames[3]).toMatchStackFrame(['Object.module.exports.test.TabBar.buttons.callback', undefined, "http://localhost:8001/git/frontend/test/allTestsFE.bundle.js", 1546, 9]);
});
it('should parse Firefox 35 Error.stack', function () {
var stackFrames = unit.parse(CapturedExceptions.FIREFOX_35);
expect(stackFrames).toBeTruthy();
expect(stackFrames.length).toBe(3);
expect(stackFrames[0]).toMatchStackFrame(['(?)()', undefined, "http://localhost:8100/test.web.bundle.js", 75, undefined]);
expect(stackFrames[1]).toMatchStackFrame(['module.exports/req.onreadystatechange', undefined, "http://localhost:8001/git/frontend/test/generated/allTestsFE.bundle.js", 5943, 1]);
expect(stackFrames[2]).toMatchStackFrame(['module.exports<.getSourceMapObject', undefined, "http://localhost:8001/git/frontend/test/generated/allTestsFE.bundle.js", 4970, 10]);
});
it('should parse another Firefox 35 Error.stack', function () {
var stackFrames = unit.parse(CapturedExceptions.FIREFOX_35_B);
expect(stackFrames).toBeTruthy();
expect(stackFrames.length).toBe(27);
expect(stackFrames[0]).toMatchStackFrame(['StackTrace$$get', undefined, "http://localhost:8100/generatedBuild/stackinfo.umd.js", 3788, 23]);
expect(stackFrames[1]).toMatchStackFrame(['[21]</module.exports', undefined, "", 3923, 27]);
expect(stackFrames[2]).toMatchStackFrame(['H', undefined, "", 47, 13]);
expect(stackFrames[3]).toMatchStackFrame(['gen', undefined, "", 12, 9]);
expect(stackFrames[4]).toMatchStackFrame(['x', undefined, "", 7, 5]);
expect(stackFrames[5]).toMatchStackFrame(['moar', undefined, "", 2, 5]);
expect(stackFrames[6]).toMatchStackFrame(['H', undefined, "", 46, 9]);
expect(stackFrames[7]).toMatchStackFrame(['G', undefined, "", 41, 13]);
expect(stackFrames[8]).toMatchStackFrame(['G', undefined, "", 40, 10]);
expect(stackFrames[9]).toMatchStackFrame(['F', undefined, "", 34, 21]);
expect(stackFrames[10]).toMatchStackFrame(['E.fn1', undefined, "", 27, 13]);
expect(stackFrames[11]).toMatchStackFrame(['D', undefined, "", 22, 9]);
expect(stackFrames[12]).toMatchStackFrame(['C', undefined, "", 18, 9]);
expect(stackFrames[13]).toMatchStackFrame(['B', undefined, "", 14, 9]);
expect(stackFrames[14]).toMatchStackFrame(['A', undefined, "", 10, 9]);
expect(stackFrames[15]).toMatchStackFrame(['unittest', undefined, "", 156, 13]);
expect(stackFrames[16]).toMatchStackFrame(['testGroup/runTest', undefined, "", 3746, 17]);
expect(stackFrames[17]).toMatchStackFrame(['[18]</module.exports<.runTestGroup', undefined, "", 3465, 9]);
expect(stackFrames[18]).toMatchStackFrame(['testGroup', undefined, "", 3752, 9]);
expect(stackFrames[19]).toMatchStackFrame(['[19]</module.exports/UnitTester.prototype.test', undefined, "", 3881, 17]);
expect(stackFrames[20]).toMatchStackFrame(['unittest', undefined, "", 153, 9]);
expect(stackFrames[21]).toMatchStackFrame(['testGroup/runTest', undefined, "", 3746, 17]);
expect(stackFrames[22]).toMatchStackFrame(['[18]</module.exports<.runTestGroup', undefined, "", 3465, 9]);
expect(stackFrames[23]).toMatchStackFrame(['testGroup', undefined, "", 3752, 9]);
expect(stackFrames[24]).toMatchStackFrame(['[19]</module.exports/UnitTester.prototype.test', undefined, "", 3881, 17]);
expect(stackFrames[25]).toMatchStackFrame(['runTest', undefined, "", 3649, 13]);
expect(stackFrames[26]).toMatchStackFrame(['[19]</module.exports/UnitTest</this.init/<', undefined, "", 3593, 17]);
});
it('should parse other IE 11 Error stacks', function () {
var stackFrames = unit.parse(CapturedExceptions.IE_11_C);
expect(stackFrames).toBeTruthy();
expect(stackFrames.length).toBe(2);
expect(stackFrames[0]).toMatchStackFrame(['{anonymous}()', undefined, "http://localhost:8100/", 47, 13]);
expect(stackFrames[1]).toMatchStackFrame(['x', undefined, "http://localhost:8100/test/moar.js", 7, 5]);
});
I can show you the code I'm using to parse these things if you want - they're done very differently from how you're doing it tho.
Btw I'd recommend that if you can't parse a line, instead of completely failing the whole parse, you include an object that contains the error or something. You're never going to be able to parse every kind of stack trace, especially since browsers may change their formats. This would allow the user to either use the original raw traceline, print some kind of error message just for that line, or do whatever kind of handling they like, without interrupting the rest of the operation. Otherwise you're gonna get a lot of cases where stacktrace.js tells users "can't get a stacktrace for you" when really you mean "I can't figure out everything about this particular line in the stacktrace".
I see that in some cases (for example, in parseFFOrSafari) you are clipping out some of the stack trace lines using filter. I really don't think this is the right thing to do - you're throwing away information that could be useful to the end user. Why throw it away? If you can't parse it, add a StackFrame that indicates you couldn't parse it. You should also put the raw line somewhere in the StackFrame so users can access that if they want / need to (say if stacktrace.js can't properly parse the line).
When parsing the stack for a file that happens to have parentheses in its name, I expected those parentheses to still be there when I got the parsed StackFrame object's fileName
.
e.g.
path/to/my (top secret) project/file.js
remains as
path/to/my (top secret) project/file.js
Parentheses are stripped out of the path.
e.g.
path/to/my (top secret) project/file.js
becomes
path/to/my top secret project/file.js`
I wrote a failing test for it that reproduces the problem, in a branch which you can see here.
This has caused us some problems running Cucumber-JS's own tests if the developer's environment has parens in the path. See cucumber/cucumber-js#1735
If you want to submit a PR with a fix for this, you'll need to start by forking this repo. If you install the gh
command-line tool, you can do that with:
$ gh repo fork stacktracejs/error-stack-parser
That should hopefully fork the repo to your GitHub account and then create a local clone of it.
In the new directory of the local clone, you can then create a branch, and pull in my commit with the failing test:
$ git checkout -b allow-parens-in-node-filename
$ git pull [email protected]:mattwynne/error-stack-parser.git allow-parens-in-node-filename
Try running the tests, and you should see one failing:
npm install
npm test
npm test
> [email protected] test
> karma start karma.conf.js --single-run
19 07 2021 14:32:05.968:INFO [karma-server]: Karma v4.4.1 server started at http://0.0.0.0:9876/
19 07 2021 14:32:05.971:INFO [launcher]: Launching browsers PhantomJS with concurrency unlimited
19 07 2021 14:32:05.975:INFO [launcher]: Starting browser PhantomJS
19 07 2021 14:32:07.389:INFO [PhantomJS 2.1.1 (Mac OS X 0.0.0)]: Connected on socket S7DEMBo_p_scyXL8AAAA with id 77822057
PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR LOG: 'DEPRECATION:', 'Setting specFilter directly on Env is deprecated and will be removed in a future version of Jasmine, please use the specFilter option in `configure`'
ErrorStackParser
#parse
✓ should parse Safari 7 Error.stack
✓ should parse Safari 8 Error.stack
✓ should parse nested eval() from Safari 9
✓ should parse Firefox 31 Error.stack
✓ should parse nested eval() from Firefox 43
✓ should parse function names containing @ in Firefox 43 Error.stack
✓ should parse IE 10 Error stacks
✓ should parse Opera 11 Error messages
✓ should parse IE 11 Error stacks
✓ should parse stack traces with @ in the URL
✓ should parse Opera 25 Error stacks
✓ should parse stack traces with @ in the URL and the method
✓ should parse Opera 9.27 Error messages
✓ should parse Safari 6 Error.stack
✓ should not parse IE 9 Error
✓ should handle webpack eval stacks
✓ should handle spaces in Node.js stacks
✓ should parse nested eval() from Edge
✓ should handle newlines in Error stack messages
✓ should parse Opera 10 Error messages
✗ should handle parentheses in Node.js stacks
Expected '/var/app/scratch/my project top secret/index.js' to equal '/var/app/scratch/my project (top secret)/index.js'.
<Jasmine>
spec/error-stack-parser-spec.js:237:52
<Jasmine>
✓ should parse V8 Error.stack
✓ should parse error stacks with Constructors
✓ should parse V8 entries with no location
✓ should parse V8 Error.stack entries with port numbers
✓ should parse nested eval() from V8
PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 26 of 26 (1 FAILED) (0.35 secs / 0.313 secs)
TOTAL: 1 FAILED, 25 SUCCESS
1) should handle parentheses in Node.js stacks
ErrorStackParser #parse
Expected '/var/app/scratch/my project top secret/index.js' to equal '/var/app/scratch/my project (top secret)/index.js'.
<Jasmine>
spec/error-stack-parser-spec.js:237:52
<Jasmine>
Now you just need to fiddle with the code until that test passes :)
Hi,
error-stack-parser
seems to fail to recognise native fetch errors.
The error doesn't seem to have a recognisable stack, so unless I wrap it with Error
it fails.
Here's a demo project to show the issue and the source. Hope that helps :).
The test was done on Chrome Version 47.0.2526.73 beta (64-bit) in Mac OS X El Capitan.
Thanks!
Darío
We have detected a problem when generating stack trace from a SyntaxError. This takes place when the error cause is due to a malformed javascript code, the output of the library is not consistent:
We would expect one the following two behaviours, being number 2 the preferred:
The code below reproduces the issue:
<html>
<head>
<title>Inline errors page test</title>
</head>
<body>
<h1>Inline errors page test</h1>
<script type="text/javascript" src="error-stack-parser.js"></script>
<script>
window.addEventListener("error", (errorEvent) => {
const stack = ErrorStackParser.parse(errorEvent.error)
console.log("stack", stack);
})
</script>
<script>
var a: // the malformed javascript here
</script>
</body>
</html>
Important: A SyntaxError generated from a bad usage of a API like JSON.parse does not reproduce the issue
<html>
<head>
<title>Inline errors page test</title>
</head>
<body>
<h1>Inline errors page test</h1>
<script type="text/javascript" src="error-stack-parser.js"></script>
<script>
window.addEventListener("error", (errorEvent) => {
const stack = ErrorStackParser.parse(errorEvent.error);
console.log("stack", stack);
})
</script>
<script>
JSON.parse('<I am not a json>') --> wrong input
</script>
</body>
</html>
This happens on all versions of the library (including the latest one).
Tested on different OS, such as MacOS, Fedora Linux, and Windows 10
It seems that the parse function it might be the good place to start with the fix. Presumably, there is new condition to be added or a change on the regex that needs to be done, or both.
On Chromium browsers the line return this.parseFFOrSafari(error); is the one being executed, which is wrong.
On our product we have followed a defensive approach to overcome the issue:
We leverage the information available in ErrorEvent. So, if the library throws an exception or generates a malformed stack trace what we do is to extract lineno, colno, and filename from such event.
I'm currently trying to normalize stack frame function names across javascript engines, by building on top of this library.
Anonymous functions from IE stack frames are filtered out, and the functionName
property on the StackFrame
object is set to undefined in https://github.com/stacktracejs/error-stack-parser/blob/master/error-stack-parser.js#L65
Knowing that a given function is anonymous is valuable information and shouldn't be filtered out.
Current output:
{
fileName: 'http://localhost:8080/test.html',
lineNumber: 20,
columnNumber: 9,
source: ' at Anonymous function (http://localhost:8080/test.html:20:9)'
},
Expect output:
{
functionName: 'Anonymous function',
fileName: 'http://localhost:8080/test.html',
lineNumber: 20,
columnNumber: 9,
source: ' at Anonymous function (http://localhost:8080/test.html:20:9)'
},
This line:
error-stack-parser/error-stack-parser.js
Line 103 in a3bf972
" error("Warning: Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s=\"%s\" or %s={value.toString()}.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.%s", "false", "loading", "loading", "false", "loading", "loading", "loading", "\n in button (created by Context.Consumer)\n in StyledButton (at overrideOptional.tsx:16)\n in Overridable(StyledButton) (at Button.tsx:108)\n in Button (created by Context.Consumer)\n in StyledButton (at Button.tsx:51)\n in ButtonWithArrow (at overrideOptional.tsx:16)\n in Overridden(Button) (created by Context.Consumer)\n in ButtonPrimary (at overrideOptional.tsx:16)\n in Overridden(Styled(Overridable(Button))) (at Submit.tsx:7)\n in Submit (at AddToCartForm.tsx:98)\n in form (created by Form)\n in FormProvider (created by Form)\n in Form (at AddToCartForm.tsx:97)\n in AddToCartForm (at ProductAddToCartForm.tsx:68)\n in ProductAddToCartForm (at ProductPageInfoSide.tsx:244)\n in div (created by Context.Consumer)\n in Card (at ProductPageInfoSide.tsx:153)\n in div (created by Context.Consumer)\n in ProductInfo (at ProductPageInfoSide.tsx:152)\n in ProductPageInfoSide (at ProductPage.tsx:194)\n in div (created by Context.Consumer)\n in ProductTop (at ProductPage.tsx:173)\n in div (created by Context.Consumer)\n in Wrapper (at Container.tsx:114)\n in ForwardRef(_c) (at ProductPage.tsx:166)\n in article (at ProductPage.tsx:165)\n in main (created by Context.Consumer)\n in Content (at PageWrapper.tsx:74)\n in div (created by Context.Consumer)\n in Page (at PageWrapper.tsx:65)\n in PortalTarget (at PageWrapper.tsx:64)\n in PageWrapper (at ProductPage.tsx:156)\n in ProductPage (at overrideOptional.tsx:16)\n in Overridable(ProductPage) (at DynamicRouteResolver.tsx:54)\n in DynamicRouteResolver (created by Context.Consumer)\n in Route (at AppRouter.tsx:25)\n in Switch (at AppRouter.tsx:14)\n in AppRouter (at App.tsx:32)\n in BreakpointsProvider (at AppProviders.tsx:38)\n in ApolloProvider (at ApolloConnector.tsx:68)\n in ApolloConnector (at AppProviders.tsx:30)\n in Router (at RouterProvider.tsx:18)\n in RouterProvider (at AppProviders.tsx:29)\n in StoreViewProvider (at AppProviders.tsx:25)\n in ErrorBoundary (at RootErrorBoundary.tsx:105)\n in RootErrorBoundary (at AppProviders.tsx:24)\n in I18nProvider (at I18nLoader.tsx:19)\n in I18nLoader (at AppProviders.tsx:23)\n in AppProviders (at App.tsx:28)\n in App (at src/index.tsx:30)") at console.error (http://localhost:3340/__cypress/runner/cypress_runner.js:140661:26)"
It should not freeze the browser.
The regex takes a very long time to parse the string
Paste in the browser console:
" error("Warning: Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s=\"%s\" or %s={value.toString()}.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.%s", "false", "loading", "loading", "false", "loading", "loading", "loading", "\n in button (created by Context.Consumer)\n in StyledButton (at overrideOptional.tsx:16)\n in Overridable(StyledButton) (at Button.tsx:108)\n in Button (created by Context.Consumer)\n in StyledButton (at Button.tsx:51)\n in ButtonWithArrow (at overrideOptional.tsx:16)\n in Overridden(Button) (created by Context.Consumer)\n in ButtonPrimary (at overrideOptional.tsx:16)\n in Overridden(Styled(Overridable(Button))) (at Submit.tsx:7)\n in Submit (at AddToCartForm.tsx:98)\n in form (created by Form)\n in FormProvider (created by Form)\n in Form (at AddToCartForm.tsx:97)\n in AddToCartForm (at ProductAddToCartForm.tsx:68)\n in ProductAddToCartForm (at ProductPageInfoSide.tsx:244)\n in div (created by Context.Consumer)\n in Card (at ProductPageInfoSide.tsx:153)\n in div (created by Context.Consumer)\n in ProductInfo (at ProductPageInfoSide.tsx:152)\n in ProductPageInfoSide (at ProductPage.tsx:194)\n in div (created by Context.Consumer)\n in ProductTop (at ProductPage.tsx:173)\n in div (created by Context.Consumer)\n in Wrapper (at Container.tsx:114)\n in ForwardRef(_c) (at ProductPage.tsx:166)\n in article (at ProductPage.tsx:165)\n in main (created by Context.Consumer)\n in Content (at PageWrapper.tsx:74)\n in div (created by Context.Consumer)\n in Page (at PageWrapper.tsx:65)\n in PortalTarget (at PageWrapper.tsx:64)\n in PageWrapper (at ProductPage.tsx:156)\n in ProductPage (at overrideOptional.tsx:16)\n in Overridable(ProductPage) (at DynamicRouteResolver.tsx:54)\n in DynamicRouteResolver (created by Context.Consumer)\n in Route (at AppRouter.tsx:25)\n in Switch (at AppRouter.tsx:14)\n in AppRouter (at App.tsx:32)\n in BreakpointsProvider (at AppProviders.tsx:38)\n in ApolloProvider (at ApolloConnector.tsx:68)\n in ApolloConnector (at AppProviders.tsx:30)\n in Router (at RouterProvider.tsx:18)\n in RouterProvider (at AppProviders.tsx:29)\n in StoreViewProvider (at AppProviders.tsx:25)\n in ErrorBoundary (at RootErrorBoundary.tsx:105)\n in RootErrorBoundary (at AppProviders.tsx:24)\n in I18nProvider (at I18nLoader.tsx:19)\n in I18nLoader (at AppProviders.tsx:23)\n in AppProviders (at App.tsx:28)\n in App (at src/index.tsx:30)") at console.error (http://localhost:3340/__cypress/runner/cypress_runner.js:140661:26)".match(/((.*".+"[^@]*)?[^@]*)(?:@)/)
I am running Cypress tests against a React app. React dumps the component stack in the stack trace when it throws an error or warning for a component.
A different RegEx, or no RegEx at all.
Would be great if error-stack-parser could be imported as ES modules.
ERROR TypeError: StackFrame is not a constructor
TypeError: StackFrame is not a constructor
at Object. (......\node_modules@soda\friendly-errors-webpack-plugin\node_modules\error-stack-parser\error-stack-parser.js:76:24)
at Array.map ()
at Object.ErrorStackParser$$parseV8OrIE [as parseV8OrIE] (...\node_modules@soda\friendly-errors-webpack-plugin\node_modules\error-stack-parser\error-stack-parser.js:56:29)
at Object.ErrorStackParser$$parse [as parse] ....\node_modules@soda\friendly-errors-webpack-plugin\node_modules\error-stack-parser\error-stack-parser.js:31:29)
at getOriginalErrorStack (...\node_modules@soda\friendly-errors-webpack-plugin\src\core\extractWebpackError.js:31:29)
at extractError (...\node_modules@soda\friendly-errors-webpack-plugin\src\core\extractWebpackError.js:22:20)
at Array.map ()
at processErrors (...\node_modules@soda\friendly-errors-webpack-plugin\src\core\transformErrors.js:31:17)
at FriendlyErrorsWebpackPlugin.displayErrors (...\node_modules@soda\friendly-errors-webpack-plugin\src\friendly-errors-plugin.js:97:29)
at doneFn (...\node_modules@soda\friendly-errors-webpack-plugin\src\friendly-errors-plugin.js:57:14)
at AsyncSeriesHook.eval [as callAsync] (eval at create (...i\node_modules\tapable\lib\HookCodeFactory.js:33:10), :18:1)
at AsyncSeriesHook.lazyCompileHook (...i\node_modules\tapable\lib\Hook.js:154:20)
at ...\node_modules\webpack\lib\Compiler.js:304:22
at Compiler.emitRecords (...\node_modules\webpack\lib\Compiler.js:499:39)
at ...\node_modules\webpack\lib\Compiler.js:298:10
at ...\node_modules\webpack\lib\Compiler.js:485:14
After also experiencing issue #51, I tried installing with yarn, but receive the following error
error An unexpected error occurred: "https://registry.yarnpkg.com/error-stack-parser/-/error-stack-parser-2.0.2.tgz: Request failed \"404 Not Found\"".
I am producing a webpack bundle and executing it using Node.js. There is an error originating in the bundle.
I have a source map. I want to parse the stack trace and apply the source map.
The following stack trace:
TypeError: __webpack_require__.i(...) is not a function
at configureStore (isomorphic-webpack:1300:115)
at Object../app/app.js (isomorphic-webpack:761:84)
at __webpack_require__ (isomorphic-webpack:621:30)
at fn (isomorphic-webpack:45:20)
at resolveOverride (/Users/gajus/Documents/dev/gajus/react-boilerplate/node_modules/isomorphic-webpack/dist/factories/createIsomorphicWebpack.js:149:14)
at Function._module2.default._load (/Users/gajus/Documents/dev/gajus/react-boilerplate/node_modules/isomorphic-webpack/node_modules/override-require/dist/overrideRequire.js:39:14)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at createCompilationPromise.then (/Users/gajus/Documents/dev/gajus/react-boilerplate/server/middlewares/frontendMiddleware.js:68:104)
Produces the following error:
/Users/gajus/Documents/dev/gajus/react-boilerplate/node_modules/isomorphic-webpack/node_modules/error-stack-parser/error-stack-parser.js:35
throw new Error('Cannot parse given Error object');
^
Error: Cannot parse given Error object
at ErrorStackParser$$parse (/Users/gajus/Documents/dev/gajus/react-boilerplate/node_modules/isomorphic-webpack/node_modules/error-stack-parser/error-stack-parser.js:35:23)
at formatErrorStack (/Users/gajus/Documents/dev/gajus/react-boilerplate/node_modules/isomorphic-webpack/dist/factories/createIsomorphicWebpack.js:200:22)
at process.on (/Users/gajus/Documents/dev/gajus/react-boilerplate/server/middlewares/frontendMiddleware.js:42:59)
at emitTwo (events.js:106:13)
at process.emit (events.js:191:7)
at processEmit [as emit] (/Users/gajus/Documents/dev/gajus/react-boilerplate/node_modules/fsevents/node_modules/signal-exit/index.js:155:32)
at emitPendingUnhandledRejections (internal/process/promises.js:85:22)
at runMicrotasksCallback (internal/process/next_tick.js:61:9)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
Today seems that the package isn't available in the npm registry.
I have tried to run npm i error-stack-parser
but it returns this error:
I have tried to open https://registry.npmjs.org/error-stack-parser and this is the result:
Thoughts??
$ cat reproduce.mjs
// @ts-check
import ErrorStackParser from "error-stack-parser"
console.log(ErrorStackParser.parse(new Error()))
$ npm remove error-stack-parser
$ npm add [email protected] && node reproduce.mjs
...
[
{
columnNumber:
$ npm remove error-stack-parser
$ npm add error-stack-parser && node reproduce.mjs
...
console.log(ErrorStackParser.parse(new Error()))
^
TypeError: ErrorStackParser.parse is not a function
at file:///workspaces/repo/reproduce.mjs:3:30
at ModuleJob.run (node:internal/modules/esm/module_job:194:25)
Node.js v18.15.0
$ grep error-stack-parser package.json
"error-stack-parser": "^3.0.0",
In Chrome, stack information is slightly different if an eval() statement is part of the stack in an attempt to pin down what line of the eval() is causing the issue. The Chrome bug report that led to this logging is here: https://code.google.com/p/v8/issues/detail?id=1914
Basically, the line in the trace ends up looking something like this:
at fn (eval at (https://www.mydomain.com:1:100), :2:20)
The StackFrame that gets returned from the parse then has as the filename and the line/column numbers of the anonymous reporting. If you are using the full stacktrace.js fromError call and thus get stacktrace-gps along for the ride, this causes stacktrace-gps to try to download https://www.mydomain.com/ <anonymous> (I'm not sure how to format this properly; there shouldn't be the space after the slash) to look for source maps. Of course, that will never be a useful case; the best you can hope for is a 404, and I'm not really sure whether the code can recover from that situation.
Now, I recognize that there is some potential debugging/logging value in what Chrome has output for the eval()-specific information, so it may be worth adding some method of preserving that for interested parties. But in the short term, it really seems like the filename/line/column returned in the StackFrame in this situation should report the information in the middle set of parentheses. At the very least, that would keep stacktrace-gps from making a useless HTTP call and even potentially blowing up.
Hi @eriwen and many thanks for your work on error-stack-parser
!
It looks like v2.1.0 has introduced a bug in TypeScript exports, preventing consumers of error-stack-parser
from using the library in the intended way.
If you have a look at line 18 in error-stack-parser.d.ts
in this diff:
Type definitions changed in v2.1.0 suggest one should import ErrorStackParser
using the default export as follows:
import ErrorStackParser from 'error-stack-parser';
ErrorStackParser.parse(...) // TypeError in 2.1.0
which is different from v2.0.7, where we'd import the module like this:
import * as ErrorStackParser from 'error-stack-parser';
ErrorStackParser.parse(...)
However, the change doesn't seem to have been applied to the associated JavaScript code, which still uses the more traditional module.exports = ErrorStackParser
export.
This means that importing the default export, as per the type definitions, results in undefined
and a TypeError
:
TypeError: Cannot read properties of undefined (reading 'parse')
Ignore the type definitions and use a var require instead:
const ErrorStackParser = require('error-stack-parser');
If possible, I'd suggest reverting the change to error-stack-parser.d.ts
:
- export default ErrorStackParser;
+ export = ErrorStackParser;
Or, if you prefer to use default exports, the associated JavaScript code would need to change to use
+ module.exports.default = ErrorStackParser
- module.exports = ErrorStackParser
If using the default export, I'd also suggest bumping the major version number, since this change is not backwards compatible.
I have problem with correct function name detection on page http://localhost:3000/#test -some
with trace generated on <button onclick="undefinedFunction()"></button>
Current stack:
error.stack
"ReferenceError: asd is not defined
at HTMLButtonElement.onclick (http://localhost:3000/#test -some:7:32)"
file: "http://localhost:3000/#test -some"
name: "HTMLButtonElement.onclick"
file:"-some"
name:"HTMLButtonElement.onclick (http://localhost:3000/#test"
add error handler and parser on simple page with address: http://localhost:3000/#test -some
(space in hash)
and click on page on <button onclick="undefinedFunction()"></button>
Chrome 51.0.2704.79
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.