Closed Agusdeluca96 closed 5 months ago
Please provide a proper reproduction (repo/stackblitz) so I can investigate
Here is a stackblitz with reproduction (also editing original message to add it): https://stackblitz.com/edit/pinia-plugin-persistedstate-ts-error-global-options
If you want to pass global options, you must use the plugin factory as such
import { createApp } from 'vue';
import { createPinia } from 'pinia';
import { createPersistedState } from 'pinia-plugin-persistedstate';
import './style.css';
import App from './App.vue';
const app = createApp(App);
const pinia = createPinia();
pinia.use(
createPersistedState({
key: (id) => `__skeleton__${id}`,
})
);
app.use(pinia);
app.mount('#app');
My bad, it was pretty clear on de doc! Thank you Sacha!
Describe the bug
When trying to set global configuration options via
piniaPluginPersistedstate
, the next typescript error get shown:Reproduction
https://stackblitz.com/edit/pinia-plugin-persistedstate-ts-error-global-options
System Info
Used Package Manager
pnpm
Validations