Skip to content

Commit 425ffc7

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 04fc182 commit 425ffc7

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
@@ -215,6 +215,12 @@
215215

216216
- `errrorCaptured` フックで `false` を返すと、エラーがそれ以上伝搬しないようにできます。これは要するに「このエラーは処理済みなので無視してください」ということです。このエラーに対して、追加の `errorCaptured` フックや `app.config.errorHandler` が呼び出されるのを防ぎます。
217217

218+
**Error Capturing Caveats**
219+
220+
- 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.
221+
222+
- <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.
223+
218224
## renderTracked <sup class="vt-badge dev-only" /> {#rendertracked}
219225

220226
コンポーネントのレンダーエフェクトによってリアクティブな依存関係が追跡されたときに呼び出されます。

0 commit comments

Comments
 (0)