3.1.1
Reproduction linkhttps://jsfiddle.net/Lom7hxn5/
Steps to reproduce$router.replace
or $router.push
twice with same pathError object provides stacktrace (stack property)
What is actually happening?No stack trace in the error object
When NavigationDuplicated
error is thrown, there is no stack trace in the error itself so when error is reported through error reporting service like Sentry
, there is absolutely no context to go with the error and so it's hard to figure out where that error originated.
Transpiled code for the NavigationDuplicated
class looks like this:
which is problematic because instantiating such function won't create a stacktrace. It would work fine with non-transpiled code (although I'm not suggesting to not transpile it):
export class NavigationDuplicated extends Error {One possible solution would be to manually set stack trace with:
this.stack = (new Error()).stack;
but I'm not sure how that would be done if transpilation is done by webpack/babel...
There is also one extra bug in that code. The line that instantiates error passes a route object to the error:
but error doesn't do anything with it:
Saving route properties on the error object would also help in deciphering source of the error.
marvinhagemeister, claudivanfilho, ashtonian, stephpasquini, sergioflores-j and 16 moreclaudivanfilho, andreasvirkus, mihlek1 and rizkyyoga
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4