npm / pinia
pinia
What changed in pinia 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-18.
2 breaking1 deprecations2 new APIs and options4 tooling13 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initpinia 422 changes
Breaking changes 2
Pinia 4 is ESM only, a technically breaking change for projects using other module formats.
Pinia upgrades to devtools-api v8, which must now be installed alongside pinia.
Deprecations 1
Warns when disposing a replaced store.
New APIs and options 2
Adds getStores() to retrieve stores.
piniaSymbol is now exported for use by developers.
Tooling 4
Errors and dev warnings are refactored with Nostics to make detected problems easier to fix.
Pinia adds a diagnostic for wrong values in plugins.
Settable getters (computed) can now be edited in devtools.
storeToRefs emits a diagnostic for invalid properties.
Fixes and other changes 13
HMR preserves runtime state of empty placeholder objects.
Shallow refs patched via object syntax now trigger updates.
Testing now notifies shallow refs on initial state.
Nuxt resolves default storesDirs against each layer.
Pinia declares compatibility with Nuxt 5.
During SSR hydration, reactive Set and Map state is replaced instead of unioned.
Types avoid treating a name ending in .vue as reserved.
The production devtools flag is guarded in the distributed output.
Re-add the missing types export so consumers can resolve Pinia's type definitions.
HMR now preserves runtime-added properties of setup store refs.
shouldHydrate now respects the skipHydrate marker on non-plain objects.
storeToRefs gracefully skips nullish values.
Subscribing the same callback twice no longer creates a duplicate watcher.