Skip to content

Commit

Permalink
Error Capturing Caveats (#3141)
Browse files Browse the repository at this point in the history
* Update options-lifecycle.md

Error capturing caveats. See [issue](vuejs/core#12575 (comment)).

* Update src/api/options-lifecycle.md

---------

Co-authored-by: Natalia Tepluhina <tarya.se@gmail.com>
  • Loading branch information
2 people authored and Abdelaziz18003 committed Jan 22, 2025
1 parent 28d371e commit efce04c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/api/options-lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,12 @@

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

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

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

## renderTracked <sup class="vt-badge dev-only" /> {#rendertracked}

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

0 comments on commit efce04c

Please sign in to comment.