Subscribe on changes!

errorCaptured/errorHandler can't catch error from created hook

avatar
Sep 29th 2020

Version

3.0.0

Reproduction link

https://codesandbox.io/s/errorcaptured-cant-catch-error-from-created-hook-x316j?file=/src/components/HelloWorld.vue

Steps to reproduce

  • throw error from Child component
  • try to catch it via errorCaptured in Parent component
  • try to catch it via global errorHandler

What is expected?

error is catched

What is actually happening?

error can't be catched

avatar
Sep 29th 2020

reserved for future notes

avatar
Sep 30th 2020

beforeCreate and created hooks in VOA are treated a bit differently since they don't have an equivalent in VCA, and that special treatment is missing the error handling:

https://github.com/vuejs/vue-next/blob/5d825f318f1c3467dd530e43b09040d9f8793cce/packages/runtime-core/src/componentOptions.ts#L665