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.

[3.0.0-rc.14] Pinia is not working with rc.14

See original GitHub issue

Environment

  • Operating System: Linux
  • Node Version: v18.4.0
  • Nuxt Version: 3.0.0-rc.14
  • Nitro Version: 1.0.0
  • Package Manager: yarn@3.2.0
  • Builder: vite
  • User Config: sourcemap, imports, experimental, css, modules, app, typescript, nitro, buildModules, build, plugins, vite, runtimeConfig, routeRules
  • Runtime Modules: normalizedModule(), normalizedModule(), normalizedModule()
  • Build Modules: @pinia/nuxt@0.4.3

Reproduction

no reproduction yet

Describe the bug

After upgrading to rc.14 (with rc.13 everything was ok) pinia in our project is not working. Trying to access any page that uses pinia throws error:

[🍍]: getActivePinia was called with no active Pinia. Did you forget to install pinia?
const pinia = createPinia()
app.use(pinia)
This will fail in production.
at Module.useStore (./node_modules/pinia/dist/pinia.mjs:1696:19)
at __vite_ssr_exports__.default (./composables/use-cookie-store-watcher/index.ts:12:45)
at setup (./layouts/default.vue:41:34)

Also this can be found in server logs:

[Vue warn]: injection "Symbol(pinia)" not found.                                                                                                                                                                                    12:36:42
[Vue warn]: Unhandled error during execution of setup function                                                                                                                                                                      12:36:42
  at <Default > // this is default layout probably
[Vue warn]: injection "Symbol(pinia)" not found.                                                                                                                                                                                    12:36:42
[Vue warn]: Unhandled error during execution of setup function                                                                                                                                                                      12:36:42
  at <Szukaj > // this is page name

I already tried with newest versions of @pinia/nuxt (0.4.3) and pinia (2.0.23) packages but it’s still not working.

Additional context

No response

Logs

No response

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
pnzz7commented, Nov 16, 2022

it seems like putting @pinia/nuxt from buildModules to modules fixed it for me

0reactions
Jozagutscommented, Nov 17, 2022

Same error, and when I try to deploy as a static site I got this: ERROR [🍍]: getActivePinia was called with no active Pinia. Did you forget to install pinia? const pinia = createPinia() app.use(pinia) This will fail in production.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pinia-plugin-persist - CodeSandbox
Zsapi/pinia-plugin-persist-repro. Environmentnode. This sandbox is in sync with main on GitHub. You have to fork to make changes
Read more >
Using vue-chartjs (4.1.1) in Nuxt (3.0.0-rc.4) doesn't build
In my app the pie chart is fed with props and reacts nicely to user inputs. I just can't deploy it for some...
Read more >
Installation - Pinia
import { createApp } from 'vue' import { createPinia } from 'pinia' import App ... In Vue 3, some features like time traveling...
Read more >
vuex | Yarn - Package Manager
Pinia has almost the exact same or enhanced API as Vuex 5, described in Vuex 5 RFC. ... Pinia also works with Vue...
Read more >
cannot find module' or its corresponding type declarations vue
This might be an IDE issue that fails to reload node_module index information. ... @vue/test-utils-next library which was introduced in 2.0.0-rc.14 version.
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