diff --git a/src/api/options-lifecycle.md b/src/api/options-lifecycle.md index bc3b92fd97..a63c304733 100644 --- a/src/api/options-lifecycle.md +++ b/src/api/options-lifecycle.md @@ -215,6 +215,12 @@ Called when an error propagating from a descendant component has been captured. - An `errorCaptured` hook can return `false` to prevent the error from propagating further. This is essentially saying "this error has been handled and should be ignored." It will prevent any additional `errorCaptured` hooks or `app.config.errorHandler` from being invoked for this error. + **Error Capturing Caveats** + + - In components with async `setup()` function (with top-level `await`) Vue **will always** try to render component template, even if `setup()` throwed error. This will likely cause more errors because during render component's template might try to access non-existing properties of failed `setup()` context. When capturing errors in such components, be ready to handle errors from both failed async `setup()` (they will always come first) and failed render process. + + - Replacing errored child component in parent component deep inside `` will cause hydration mismatches in SSR. Instead, try to separate logic that can possibly throw from child `setup()` into separate function and execute it in the parent component's `setup()`, where you can safely `try/catch` the execution process and make replacement if needed before rendering the actual child component. + ## renderTracked {#rendertracked} Called when a reactive dependency has been tracked by the component's render effect.