Closed marcelodelta closed 1 year ago
Hi @marcelodelta Thanks for reporting this issue. I am not very familiar with Vue or pinia but I can take a look. Can you please create a repo that reproduces this issue?
Hello, thank you very much for your attention.
I committed a repository
https://github.com/marcelodelta/adonisjs-inertiajs-vuejs-pinia-typescript
Hello @eidellev.
Are you okay? did you see it?
I managed to resolve. The store file must be js and not ts. Thank you for your attention.
Pinia does not initialize in project with inertiajs, vue and adonisjs.
I tried a few different ways, but inertiajs doesn't activate pinia. And when I try to access the stores, the error is shown in the console stating that the pinia is not yet active.
Note: Pinia is installed.
I tried in different ways, but I can't understand. And it's been a few days.
Any ideas that might help resolve this issue?
grateful for the attention.
app.js
Home.vue
counter.ts
import { defineStore } from 'pinia'
export const useCounterStore = defineStore('counter', { state: () => ({ count: 0, name: 'Eduardo' }), getters: { doubleCount: (state) => state.count * 2, }, actions: { increment() { this.count++ }, }, })
Error: [🍍]: "getActivePinia()" was called but there was no active Pinia. Did you forget to install pinia?