Throwing an error in a component's mounted hook makes the whole app unresponsive
Version
3.0.10
Reproduction link
https://jsfiddle.net/dnq34Les/29/
Steps to reproduce
- click the button multiple times
What is expected?
counter should keep incrementing
What is actually happening?
counter stops at 1
This is happening in a much more complex app where when a lifecycle hook errors somewhere deep in the app, the whole app stops rendering updates. Only seems to happen when the component creation is delayed (thus the v-if="foo"
in the reproduction).
This only happens in dev - the intention is that it forces you to consider handling the error with error handlers. Once you add a global error handler or onErrorCaptured
somewhere up the parent chain, the app will be able to function despite the error. Production mode also auto-recovers even without error handlers to avoid affecting end users.