Skip to content

State properties become undefined when the app is mounted #2904

@olinox14

Description

@olinox14

Reproduction

https://stackblitz.com/edit/nuxt-starter-bv1ucjn7?file=app.vue

Steps to reproduce the bug

Connect to the provided stackblitz.
It's configured with Nuxt (v3.15.4), Pinia (2.3.1) and @pinia/nuxt (v0.9.0), in SSR mode.

When displaying the app.vue page, the store.a property shows up, but disappear when the app is mounted.

Adding a reference to this property in the onMounted method will throw and error, saying store.a is undefined.

capture-2025-01-30_10.27.36.webm

Expected behavior

Store properties shall keep their value after hydratation.

Actual behavior

Store properties become undefined on hydratation.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions