You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After updating the @vueuse/core to version 9.8.2 I'm getting this error everytime I try to set a value in the storage using an action defined in a Pinia store
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a VueUse issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/core instead.
Check that this is a concrete bug. For Q&A open a GitHub Discussion.
seems this is because of @antfu's change in 800f74f.
looks like that was changed so two instances of useStorage are aware of each others mutations.
however, you can only construct a StorageEvent for an instance of Storage (local, session, etc. native things since you can't actually new up Storage directly iirc).
im guessing various people were already using useStorage with non-native storage objects, which this change will have now broken.
also @antfu, it does seem like misuse of the storage event. the intent of the native storage event is so other windows are aware of storage changes, not within the same window. technically you could solve this by newing up a CustomEvent instead with the same detail structure, same name. But i feel like you'd still be going against what a storage event is for... maybe because of that you should use your own event rather than trying to reuse the name of a native one?
firing these non-standard storage events on the window could confuse third party code/libraries which depend on that event working as defined in the spec.
Describe the bug
After updating the
@vueuse/core
to version 9.8.2 I'm getting this error everytime I try to set a value in the storage using an action defined in a Pinia storeRolling back to version 9.8.1 of
@vueuse/core
seems to solve the issue.Reproduction
https://stackblitz.com/edit/usestorage-issue-pinia?file=src/App.vue
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: