I try to use Pinia but it never works. Doesn't matter if I install it with Vite at the start of the project or if I add it later. It always write the same error. This is an example from my last project.
This is my main.js
import { createApp } from "vue";
import { createPinia } from "pinia";
import App from "./App.vue";
import draggable from "vuedraggable";
const app = createApp(App);
app.use(createPinia());
app.component('draggable', draggable);
app.mount("#app");
This is start of my App.vue
<script setup>
import { ref } from "vue";
import draggable from "vuedraggable";
import {useCounterStore} from "./stores/counter";
const storeCounter = useCounterStore();
The error appears when I enter
const storeCounter = useCounterStore();