How to accept HMR on option API vue 3 + Pinia

I had some trouble with use pinia and vue 3(opt). In my case i can’t understand how to accept hmr on pinia storages.

import { defineStore } from 'pinia'

export default defineStore('user', {
    state: () => ({
        authState: false,
   }))

defining store view like this, it not a function that i can void later in

import.meta.hot.accept(storeName, import.meta.hot)

and now im stooped with it and can’t understand how to accept using Vite hmr with my storages

Already try to use import.meta.hot.accept(storeName, import.meta.hot) in my main component Application.vue but it return false with thow about unknown modules

Anybody know how to use HMR stores with Option API of VUE 3?

  • in docs of pinia used composition api and define store look like this “` export const = defineStore()“` in my case it look like a export default defineStore()

    – 

Leave a Comment