-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Description
Vue version
3.2.47
Link to minimal reproduction
https://stackblitz.com/edit/github-qw7apw-58cjm8
Steps to reproduce
Click 'Trigger error in data'. it will try to load a component where there is a JS error inside the data
function on the component.
Then click 'click here to see stale instance' - it will perform a hard reload, calling getCurrentInstance() on the server and revealing that the instance was not unset.
What is expected?
I expect the current component instance to be unset if there is an error inside data
.
What is actually happening?
The current component instance is not unset.
System Info
No response
Any additional comments?
This is very similar to #6110 which has already been fixed. The difference is that the error happens in data
instead of during rendering.
I had some troubles with our SSR setup and Pinia using the wrong instance after an error. Pinia looks for getCurrentInstance
and uses that instance to inject the current pinia instance.