Subscribe on changes!

Throwing an error in a component's mounted hook makes the whole app unresponsive

avatar
Apr 1st 2021

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).

avatar
Apr 1st 2021

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.

avatar
Apr 1st 2021

Seems a bit harsh to completely stop updating by default and adds quite a bit of uncertainty when trying to recreate an error. I also found it quite horrifying that the app just stopped completely without any indication that this wouldn't happen in production.