-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Current instance is not unset after error in data() on SSR #7733
Labels
🔨 p3-minor-bug
Priority 3: this fixes a bug, but is an edge case that only affects very specific usage.
🐞 bug
Something isn't working
scope: ssr
Comments
Similarly, throwing an error in |
Here are two testcases that can be added to
|
DrPhil
pushed a commit
to DrPhil/vue-core
that referenced
this issue
Feb 17, 2023
haoqunjiang
added
the
🔨 p3-minor-bug
Priority 3: this fixes a bug, but is an edge case that only affects very specific usage.
label
Apr 4, 2023
9 tasks
yyx990803
pushed a commit
to DrPhil/vue-core
that referenced
this issue
May 19, 2023
yyx990803
pushed a commit
that referenced
this issue
May 19, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
🔨 p3-minor-bug
Priority 3: this fixes a bug, but is an edge case that only affects very specific usage.
🐞 bug
Something isn't working
scope: ssr
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.The text was updated successfully, but these errors were encountered: