NuxtN
Nuxtβ€’11mo ago
Jovan KočiΔ‡

Pinia store with Nuxt layers

We have an issue with the Pinia store when it is used in the Nuxt layers.

The error is:

[nuxt] error caught during app initialization Error: [🍍]: "getActivePinia()" was called but there was no active Pinia.


The layer is part of the monorepo, and when used within the monorepo, it works.
It also works when it is used in the other project, by extending it via Github like:

  extends: [
    ['github:repo/Layer#master'],
  ],


but when we try to use it locally, it fails

  extends: [
    ['/some/local/path/repo/Layer'],
  ],


Here is the GH discussion:
https://github.com/vuejs/pinia/discussions/2378#discussioncomment-12096928
GitHub
What problem is this solving Allow the possibility to use pinia with nuxt layers. Proposed solution It would be awesome to have Nuxt layer support similar to nuxt/i18n, where the default stores are...
Was this page helpful?