Nuxt.js 2 + nuxt-vite + pinia error
See original GitHub issueReproduction
Thank you so much for such a great state managing lib for Vue. Pinia works well with Nuxt as well. However, when I tried to use it along with nuxt-vite, an issue happen from the start. I tried with the fresh install and also, there is a reproduction link to Codesandbox:
Steps to reproduce the behavior
- Initialize a fresh Nuxt universal app + install the dependencies (the latest versions are used at the moment):
"dependencies": { "@nuxtjs/composition-api": "^0.29.2", "@pinia/nuxt": "0.0.2", "nuxt": "^2.15.8", "pinia": "^2.0.0-rc.9" }, "devDependencies": { "nuxt-vite": "^0.2.4" }
- Add required modules into “buildModules” section of nuxt.config,js:
buildModules: ["nuxt-vite", "@nuxtjs/composition-api/module", "@pinia/nuxt"],
- Run
npm run dev
- See the error
Expected behavior
The app launched correctly with listed modules/configurations.
Actual behavior
The app won’t launch because of the error.
This is comes in the console:
Uncaught SyntaxError: The requested module '/node_modules/pinia/dist/pinia.cjs?import' does not provide an export named 'defineStore'
Additional information
node version is 14.17.3 npm version is 7.24.0
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Nuxt.js - Pinia
Using Pinia with Nuxt.js is easier since Nuxt takes care of a lot of things ... Pinia supports Nuxt Bridge and Nuxt 3....
Read more >Newest 'nuxt.js' Questions - Stack Overflow
Hello I'm currently having issues with the integration of pinia in Nuxt3 ... Error "URL parsing failed" in Nuxt.js2 when using the command...
Read more >Nuxt 3 and Pinia - Vuex - Cody Bontecou
Integrate Pinia as your state management library for your Nuxt 3 application. ... nuxt.config.js import { defineNuxtConfig } from 'nuxt3' export default ...
Read more >Nuxt Vite
Vite (pronounced 'veet') is a no-bundler alternative to webpack made by Vue.js ... Vite mode is experimental and many nuxt modules are still...
Read more >Nuxt 3 + Pinia + Tailwind TDD Todo App with Vitest (Part 1)
Subscribe - https://tinyurl.com/yddc7k3tHomepage - https://kaizen.servicesTwitter - https://twitter.com/eckhardtdreyerBlog ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@posva https://stackblitz.com/github/Ttou/nuxt2-pinia-issue
there’s any update for this issue and pr #781?