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' does not provide an export named 'default' #198

Closed
enkot opened this issue Sep 25, 2022 · 2 comments
Closed

The requested module 'vue' does not provide an export named 'default' #198

enkot opened this issue Sep 25, 2022 · 2 comments

Comments

@enkot
Copy link

enkot commented Sep 25, 2022

Trying to use pinia or vue-use in the fresh Nuxt3 project, but getting this error:

[nuxt] [request error] [unhandled] [500] The requested module 'vue' does not provide an export named 'default'
  at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)  
  at async ModuleJob.run (node:internal/modules/esm/module_job:189:5)  
  at async Promise.all (index 0)  
  at async ESMLoader.import (node:internal/modules/esm/loader:533:24)  
  at async ViteNodeRunner.interopedImport (./node_modules/.pnpm/[email protected]/node_modules/vite-node/dist/client.mjs:268:17)  
  at async ViteNodeRunner.directRequest (./node_modules/.pnpm/[email protected]/node_modules/vite-node/dist/client.mjs:175:24)  
  at async ViteNodeRunner.cachedRequest (./node_modules/.pnpm/[email protected]/node_modules/vite-node/dist/client.mjs:128:12)  
  at async request (./node_modules/.pnpm/[email protected]/node_modules/vite-node/dist/client.mjs:151:16)  
  at async ./node_modules/.pnpm/@[email protected]/node_modules/@vueuse/shared/index.mjs:1:238  
  at async ViteNodeRunner.directRequest (./node_modules/.pnpm/[email protected]/node_modules/vite-node/dist/client.mjs:251:5)

package.json:

{
  "private": true,
  "scripts": {
    "build": "nuxt build",
    "dev": "nuxt dev",
    "generate": "nuxt generate",
    "preview": "nuxt preview",
    "postinstall": "nuxt prepare"
  },
  "devDependencies": {
    "@vueuse/nuxt": "^9.2.0",
    "@pinia/nuxt": "^0.4.2",
    "nuxt": "3.0.0-rc.11"
  }
}

Environment:

- Operating System: `Darwin`
- Node Version:     `v16.17.0`
- Nuxt Version:     `3.0.0-rc.11`
- Nitro Version:    `0.5.4`
- Package Manager:  `[email protected]`
- Builder:          `vite`
- User Config:      `-`
- Runtime Modules:  `-`
- Build Modules:    `-`
@avinean
Copy link

avinean commented Sep 26, 2022

Look like this pinia problem. As it uses [email protected] https://github.com/vuejs/pinia/blob/v2/pnpm-lock.yaml#L116.
While there is an attempt to fix this in the latest version of vue-demi v0.13.10...v0.13.11

But probably i'm wrong as this one antfu/vitesse-nuxt#61 doesn't work as well

@isabel-anastasiadis-boost

We were running into this problem intermittently locally when we were updating to Vue3. We found that when switching between the "Vue2" and "Vue3" branches, we'd sometimes need to delete our node_modules and rerun yarn install.

So it seems like maybe a yarn issue where somehow it isn't clearing out old stuff, and old and new node_modules are interfering with one another...?

@enkot enkot closed this as completed Feb 7, 2024
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

3 participants