-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Vue.config.errorHandler
does not catch errors thrown in lifecycle hooks
#4730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
As stated in the docs, this handle only catches errors during render:
Demo: https://jsfiddle.net/Linusborg/o2azdhbx/1/ But it might be a good enhancement to make this possible for lifecycle hooks as well. Optinions @vuejs/vue ? |
Why is this not considered an error during render? Did it not happen while rendering the parent component? |
It's quite annoying, because a non-cought error can stop a SPA working. For example using a small catch around watcher.run() in flushSchedulerQueue makes live easier if an error happens while evaluating a watcher:
|
Implemented in |
still exist in the newest Vue 2.2.4 |
This did land in 2.2. If you still experience problems, please open a new issue, with a live reproduction on jsfiddle. |
move to #5198 |
Vue.js version
2.1.9
Reproduction Link
https://jsfiddle.net/o2azdhbx/
Steps to reproduce
What is Expected?
Expect to see an alert saying "Caught an error"
What is actually happening?
See an uncaught exception in the console
The text was updated successfully, but these errors were encountered: