N
Nuxt2mo ago
pook1574

Why don't I have access to Pinia when I try to pull types?

No description
6 Replies
pook1574
pook1574OP2mo ago
I'v tried this solution , adding an alias to my config... but this didn't work
alias: {
pinia: "/node_modules/@pinia/nuxt/node_modules/pinia/dist/pinia.mjs"
}
alias: {
pinia: "/node_modules/@pinia/nuxt/node_modules/pinia/dist/pinia.mjs"
}
pook1574
pook1574OP2mo ago
Stack Overflow
Cannot find module 'pinia/dist/pinia.mjs' when using run dev
I setup Pinia on top of fresh Nuxt3 app and start dev server, with exactly these commands in order: npx nuxi init nuxt-app cd nuxt-app npm install npm install @pinia/nuxt npm run dev Dev server runs
pook1574
pook1574OP2mo ago
I tried running npm i pinia -f but it seemed to have broke some stuff and did not work correctly etither
Cue
Cue2mo ago
Ensure you’ve installed both pinia and @pinia/nuxt, added @pinia/nuxt module in nuxt config, and executed npx nuxi prepare You do not need the pinia alias.
pook1574
pook1574OP2mo ago
Why is it necessary to download pinia separately when using the nuxt module for it? Isn't that the point of the modules, to buddle dependencies? @cuebit
Cue
Cue2mo ago
Because typescript doesn’t know Pinia exists since it’s a sub dependency. It’s not needed if you’re just using it out of the the box, but it’s require for module resolution when importing from the module directly.
Want results from more Discord servers?
Add your server