New Promise API seems to break `next(false)` implementation in guard
See original GitHub issueVersion
3.1.1
Reproduction link
https://jsfiddle.net/ox6qpz9t/1/
Steps to reproduce
- Open console
- Click in
foo
button that will navigate programmatically tofoo
route (with replace method) that has abeforeEnter
guard. - In the console de error
Uncaught (in promise) false
will appear when navigation is being aborted in guard withnext(false)
What is expected?
Abort navigation without error
What is actually happening?
Aborted navigation with unhandled promise error in console.
In version 3.0.7, with the old API (not the new one that returns a promise) was working fine.
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (6 by maintainers)
Top Results From Across the Web
Uncaught (in promise) undefined - Vue-router - Stack Overflow
Based on my experience over the past few days, it is critical to catch errors in the function that calls this.$router.push() .
Read more >Error handling with promises
Asynchronous actions may sometimes fail: in case of an error the corresponding promise becomes rejected. For instance, fetch fails if the remote server...
Read more >25. Promises for asynchronous programming - Exploring JS
The Promise API is about delivering results asynchronously. A Promise object (short: Promise) is a stand-in for the result, which is delivered via...
Read more >Node.js v19.3.0 Documentation
If your code is callback-based, it is enough to promisify it with util.promisify() so it starts working with native promises. If you need...
Read more >How To Handle Async Data Loading, Lazy Loading, and Code ...
React has a special component called Suspense that will display placeholders while the browser is loading your new component. In future versions ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It is a breaking change if somebody has to change code to implement the new library and maintain the same behavior.
it’s not a major api change. It is even backwards compatible, we can still use callbacks but now when no callbacks are provided, the navigation abortion is visible unless the promise is caught