Skip to content

Current instance is not unset after error in data() on SSR #7733

@DrPhil

Description

@DrPhil

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.

Metadata

Metadata

Assignees

Labels

🔨 p3-minor-bugPriority 3: this fixes a bug, but is an edge case that only affects very specific usage.🐞 bugSomething isn't workingscope: ssr

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy