pinia: Not able to use pinia: No matching export in "node_modules/pinia/node_modules/vue-demi/lib/index.mjs" for import "hasInjectionContext"
Reproduction
https://github.com/shree-c/mock_two_test_pinia
Steps to reproduce the bug
Expected behavior
I am doing basic activity such as creating a store and importing it into a component.
Actual behavior
Vite not able to build both for dev and prod.
I am getting the following error on vite terminal:
No matching export in "node_modules/pinia/node_modules/vue-demi/lib/index.mjs" for import "hasInjectionContext"
Additional information
No response
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 3
- Comments: 15 (2 by maintainers)
You need to update vue to 3.3. I should have set the peer dep…
For me, work update to vue 3.3.4
if you use uni-app, it’s inner vue version is 3.2.47. we must be use pinia 2.0.x
“hasInjectionContext” is not exported by “node_modules/.pnpm/pinia@2.1.1_typescript@5.0.4+vue@3.3.3/node_modules/vue-demi/lib/index.mjs”, imported by “node_modules/.pnpm/pinia@2.1.1_typescript@5.0.4+vue@3.3.3/node_modules/pinia/dist/pinia.mjs”.
Argg… had to downgrade to 2.0.35 because of this bug. @posva There are a lot of 2.7 installations in the field. Upgrading to vue 3.x is very often not possible. So to others with the same problem: Vue 2.7 only works with Pinia 2.0.35 (and below???, not tested)
@shree-c @shunyue1320 hey guys, any updated? i have the same issue while migrating from vue-cli to vite