Getting the "no active Pinia" error when using Pinia in external file inside the script setup #2777
Unanswered
MooseSaeed
asked this question in
Help and Questions
Replies: 1 comment 2 replies
-
Your So basically you can't use your stores in the |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Reproduction
https://github.com/MooseSaeed/pinia-repro/tree/master
Steps to reproduce the bug
.src/utils/file.ts
App.vue
, import this function from the file you created and use the function in the script setup.Expected behavior
According to the docs
And since the file that is using the the store is used within the script setup, it should work fine.
Actual behavior
This error will show up in the console
Additional information
The issue doesn't occur when I:
RouterView
.Beta Was this translation helpful? Give feedback.
All reactions