Using Pinia app crashes with Error: The requested module 'vue-demi' does not provide an export named 'hasInjectionContext' #2628
-
Reproductionhttps://pinia.vuejs.org/ssr/nuxt.html Steps to reproduce the bugSimilar issues online say it's a pinia version thing but nothing works. Expected behaviorpinia to work with Nuxt3 seamlessly Actual behaviorApp crashes and cannot get the server to start. Additional information
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
This error means you are using an outdated version of vue-demi. Use pnpm dedupe, pnpm why, and pnpm update to ensure you are using the latest version. BTW, this is unrelated to pinia |
Beta Was this translation helpful? Give feedback.
-
Hi, @posva Got same error when use latest pinia.mjs:6 Uncaught SyntaxError: The requested module '/node_modules/.pnpm/vue-demi@0.14.7_vue@3.4.21/node_modules/vue-demi/lib/index.mjs?v=73e94a2d' does not provide an export named 'hasInjectionContext' (at pinia.mjs:6:10) ******$ pnpm list vue-demi --depth 10
Legend: production dependency, optional only, dev only
**project name**@0.0.0 /Users/****/workspace/**project name**
dependencies:
pinia 2.1.7
└── vue-demi 0.14.7
******$ pnpm list vue --depth 10
Legend: production dependency, optional only, dev only
**project name**@0.0.0 /Users/****/workspace/**project name**
dependencies:
vue 3.4.21
devDependencies:
@dcloudio/uni-automator 3.0.0-4000820240401001
└─┬ @dcloudio/uni-cli-shared 3.0.0-4000820240401001
└─┬ @vue/server-renderer 3.3.11
└─┬ vue 3.4.21 peer
└─┬ @vue/server-renderer 3.4.21
└── vue 3.4.21 peer
@dcloudio/uni-cli-shared 3.0.0-4000820240401001
└─┬ @vue/server-renderer 3.3.11
└─┬ vue 3.4.21 peer
└─┬ @vue/server-renderer 3.4.21
└── vue 3.4.21 peer
@dcloudio/vite-plugin-uni 3.0.0-4000820240401001
├─┬ @dcloudio/uni-cli-shared 3.0.0-4000820240401001
│ └─┬ @vue/server-renderer 3.3.11
│ └─┬ vue 3.4.21 peer
│ └─┬ @vue/server-renderer 3.4.21
│ └── vue 3.4.21 peer
├─┬ @vitejs/plugin-vue 4.6.2
│ └─┬ vue 3.4.21 peer
│ └─┬ @vue/server-renderer 3.4.21
│ └── vue 3.4.21 peer
└─┬ @vitejs/plugin-vue-jsx 3.1.0
└─┬ vue 3.4.21 peer
└─┬ @vue/server-renderer 3.4.21
└── vue 3.4.21 peer |
Beta Was this translation helpful? Give feedback.
-
I'm not sure why, but I'm finding that the latest Workaround: If I set my I tried setting the overrides to
I'm guessing this is probably a |
Beta Was this translation helpful? Give feedback.
This error means you are using an outdated version of vue-demi. Use pnpm dedupe, pnpm why, and pnpm update to ensure you are using the latest version.
BTW, this is unrelated to pinia