@pinia/nuxt error on fresh Nuxt project

Hello, I just created a fresh Nuxt project using npx nuxi@latest init, and after adding the module @pinia/nuxt` through the dev tools, I now get an error:
[vite-node] [ERR_LOAD_URL] pinia

at pinia
[vite-node] [ERR_LOAD_URL] pinia

at pinia
Dependencies:
"dependencies": {
"nuxt": "^3.14.0",
"vue": "latest",
"vue-router": "latest"
},
"devDependencies": {
"@pinia/nuxt": "^0.7.0",
"@vueuse/nuxt": "^11.2.0"
}
"dependencies": {
"nuxt": "^3.14.0",
"vue": "latest",
"vue-router": "latest"
},
"devDependencies": {
"@pinia/nuxt": "^0.7.0",
"@vueuse/nuxt": "^11.2.0"
}
Since Nuxt 3.14 was released a few hours ago, I tried downgrading to Nuxt 3.13 but that didn't help. And I can't downgrade further without downgrading pinia too (that might solve the issue but I would prefer first trying to solve the issue with the latest versions).
No description
3 Replies
kapa.ai
kapa.ai3w ago
Hi @UristDoomhammer. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Based on the information provided in your question and the knowledge sources available, it seems you're encountering an issue with Pinia in a fresh Nuxt project. Let's address this step by step: 1. First, it's worth noting that you've correctly identified that Nuxt 3.14 was recently released. However, downgrading to 3.13 didn't resolve the issue, which suggests it might not be directly related to the Nuxt version. 2. The error you're seeing ([vite-node] [ERR_LOAD_URL] pinia) appears to be related to Vite's node resolution, which is used by Nuxt for server-side rendering. 3. One possible solution, based on a similar issue reported in the Nuxt GitHub repository, is to update your Vue dependency. According to a comment on this GitHub issue (https://github.com/nuxt/nuxt/issues/28837), updating Vue to version 3.5 and adding an override for Nuxt to use this Vue version might help:
"dependencies": {
"nuxt": "^3.14.0",
"vue": "^3.5",
"vue-router": "latest"
},
"overrides": {
"nuxt": {
"vue": "^3.5"
}
}

"dependencies": {
"nuxt": "^3.14.0",
"vue": "^3.5",
"vue-router": "latest"
},
"overrides": {
"nuxt": {
"vue": "^3.5"
}
}

4. After making these changes, you should delete your node_modules folder and package-lock.json file, then reinstall your dependencies. 5. If the above doesn't work, you might want to try using the Nuxt CLI to add the Pinia module instead of adding it manually. You can do this with the following command:
npx nuxi module add pinia

npx nuxi module add pinia

This command should handle the installation and configuration of Pinia for your Nuxt project automatically, as described in the Nuxt documentation (https://nuxt.com/docs/api/commands/module). 6. If you're still encountering issues after trying these steps, it might be worth checking if there are any known compatibility issues between the latest versions of Nuxt, Vue, and Pinia. In that case, you might need to consider using slightly older but stable versions of these dependencies. Remember, when dealing with very recent releases of frameworks and libraries, it's not uncommon to encounter temporary compatibility issues. If the problem persists, you might want to report it as an issue on the Nuxt or Pinia GitHub repositories. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3w ago
<@134109686441050112> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
UristDoomhammer
UristDoomhammerOP3w ago
Tried step 3. and step 5., that didn't change anything. Well for now I reverted to pinia 0.5.5, and it works. I opened an issue on Pinia side: https://github.com/vuejs/pinia/issues/2822
Want results from more Discord servers?
Add your server