Subscribe on changes!

Next component's `setup` throw an error, turn back and last component crashed as well

avatar
Mar 5th 2021

Version

3.0.7

Reproduction link

https://cdpn.io/wzhzzmzzy/debug/poNZOMM/PNkvYXXQLgYA#/

Steps to reproduce

  1. Open chrome dev console
  2. Click "About" link
  3. Click "Home" link

What is expected?

At last, <Home /> component should be rendered successfully.

What is actually happening?

<Home /> component missed, and there's an error:

TypeError: Cannot read property 'parentNode' of null

[Vue warn]: Unhandled error during execution of scheduler flush. This is likely a Vue internals bug. 
Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/vue-next 

How should I catch and handle errors throw by setup function appropriately?

avatar
Mar 5th 2021

ur reproduction link shows 403 error.

avatar
Mar 5th 2021

Provide the editable codepen please: https://codepen.io/jh3y/pen/PoGbxLp

avatar
Mar 6th 2021
avatar
Mar 6th 2021

I think this is intended in DEV,if errorCapturedHooks or appErrorHandler is not configured. and the update() of component still in the queue.

avatar
Mar 6th 2021

In CodePen, onErrorCapture in root could not catch the error that thrown by child. But I tried onErrorCapture and app.config.errorHandler locally, they all can get it settled, both at ssr and csr. Thanks a lot.