pinia-class-component icon indicating copy to clipboard operation
pinia-class-component copied to clipboard

Cannot read properties of undefined (reading '_s')

Open ghost opened this issue 9 months ago • 2 comments

https://github.com/Maakdev/nuxt-pinia-class

The problem is after build of project

500 Cannot read properties of undefined (reading '_s')

ghost avatar Mar 18 '25 15:03 ghost

[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"

ghost avatar Mar 19 '25 09:03 ghost

return function () {
        // return useStore();
        const nuxtApp = (0, unctx_1.getContext)('nuxt-app').tryUse();
        console.log('nuxtApp', nuxtApp)
        if (nuxtApp) {
            return nuxtApp.runWithContext(() => useStore(nuxtApp.$pinia));
        }
    };

ghost avatar Mar 19 '25 17:03 ghost