Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The requested module 'vue-demi' does not provide an export named 'hasInjectionContext' #230

Closed
ncnt257 opened this issue May 18, 2023 · 6 comments

Comments

@ncnt257
Copy link

ncnt257 commented May 18, 2023

I'm using Nuxt 3.1.1 with vueuse/nuxt 9.13.0 (NodeJS 16.3.0). I just reinstalled the packages yesterday and meet this error.

The requested module 'vue-demi' does not provide an export named 'hasInjectionContext'

at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:181:5)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:281:24)

@kumv-net
Copy link

pinia same error,need fix as soon as possible

@kumv-net
Copy link

kumv-net commented May 19, 2023

caught SyntaxError: The requested module '/@fs/E:/xxx/node_modules/.pnpm/vue-demi@0.14.5_vue@3.3.4/node_modules/vue-demi/lib/index.mjs?v=5975676c' does not provide an export named 'hasInjectionContext' (at pinia.mjs:6:10)

http://localhost:5173/@fs/E:/xxx/node_modules/.pnpm/pinia@2.1.3_typescript@5.0.4_vue@3.3.4/node_modules/pinia/dist/pinia.mjs

import { hasInjectionContext, inject, toRaw, watch, unref, markRaw, effectScope
, ref, isVue2, isRef, isReactive, set, getCurrentScope, onScopeDispose, getCurrentInstance
, reactive, toRef, del, nextTick, computed, toRefs } from
"/@fs/E:/xxx/node_modules/.pnpm/vue-demi@0.14.5_vue@3.3.4/node_modules/vue-demi/lib/index.mjs?v=5975676c";

@Teaghy
Copy link
Contributor

Teaghy commented May 19, 2023

捕获语法错误:请求的模块'/@fs/E:/xxx/node_modules/.pnpm/vue-demi@0.14.5_vue@3.3.4/node_modules/vue-demi/lib/index.mjs?v=5975676c'确实不提供名为“hasInjectionContext”的导出(在 pinia.mjs:6:10)

http://localhost:5173/@fs/E:/xxx/node_modules/.pnpm/pinia@2.1.3_typescript@5.0.4_vue@3.3.4/node_modules/pinia/dist/pinia.mjs

import { hasInjectionContext, inject, toRaw, watch, unref, markRaw, effectScope , ref, isVue2, isRef, isReactive, set, getCurrentScope, onScopeDispose, getCurrentInstance, reactive, toRef, del, nextTick, computed, toRefs } from "/@fs/ E:/xxx/node_modules/.pnpm/vue-demi@0.14.5_vue@3.3.4/node_modules/vue-demi/lib/index.mjs?v=5975676c";

In vue-demi, 'hasInjectionContext' is provided by Vue in version 3. Please check if your Vue version is up-to-date and provides this method. I'm using the latest version of Vue and Pinia, and I haven't encountered the issue you mentioned. You can try it out.

@esorribas
Copy link

  1. Drop "overrides>vue" directive on package.json
  2. npm uninstall pinia
  3. npm install --legacy-peer-deps pinia

@McLamy
Copy link

McLamy commented May 22, 2023

@esorribas After your comment I was able to get "NITRO_PRESET=firebase yarn build" up and running 👍

@marcodarko
Copy link

Any luck with this? I've tried all the things online and absolutely no luck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants