question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Nuxt.js 2 + nuxt-vite + pinia error

See original GitHub issue

Reproduction

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

  1. 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" }
  2. Add required modules into “buildModules” section of nuxt.config,js: buildModules: ["nuxt-vite", "@nuxtjs/composition-api/module", "@pinia/nuxt"],
  3. Run npm run dev
  4. 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:open
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
antlionguardcommented, May 11, 2022

there’s any update for this issue and pr #781?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found