Skip to content

Commit efce04c

Browse files
GwynervaNataliaTepluhina
authored andcommitted
Error Capturing Caveats (#3141)
* Update options-lifecycle.md Error capturing caveats. See [issue](vuejs/core#12575 (comment)). * Update src/api/options-lifecycle.md --------- Co-authored-by: Natalia Tepluhina <[email protected]>
1 parent 28d371e commit efce04c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/api/options-lifecycle.md

+6
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,12 @@
209209

210210
- يمكن لخطاف `()errorCaptured` أن يرجع `false` لمنع الخطأ من الانتشار أكثر. هذا يعني بشكل أساسي "تم التعامل مع هذا الخطأ ويجب تجاهله." سيمنع أي خطافات `()errorCaptured` إضافية أو `app.config.errorHandler` من الاستدعاء لهذا الخطأ.
211211

212+
**Error Capturing Caveats**
213+
214+
- 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.
215+
216+
- <sup class="vt-badge" data-text="SSR only"></sup> Replacing errored child component in parent component deep inside `<Suspense>` 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.
217+
212218
## renderTracked <sup class="vt-badge dev-only" /> {#rendertracked}
213219

214220
يستدعى عندما يتم تتبع اعتمادية تفاعلية بواسطة تأثير تصيير المكون.

0 commit comments

Comments
 (0)