element-plus / element-plus-nuxt

Element Plus module for Nuxt
MIT License
130 stars 16 forks source link

Uncaught SyntaxError: The requested module '/_nuxt/node_modules/.pnpm/dayjs@1.11.12/node_modules/dayjs/dayjs.min.js?v=4385ae0a' does not provide an export named 'default' (at utils.mjs?v=4385ae0a:1:8) #113

Closed vcc0827 closed 1 month ago

vcc0827 commented 1 month ago

install element-plus/nuxt version 1.0.9 and comes an error: Uncaught SyntaxError: The requested module '/_nuxt/node_modules/.pnpm/dayjs@1.11.12/node_modules/dayjs/dayjs.min.js?v=4385ae0a' does not provide an export named 'default' (at utils.mjs?v=4385ae0a:1:8)

tolking commented 1 month ago

Can you provide a minimal example?

vcc0827 commented 1 month ago

Can you provide a minimal example?

  1. using command build a nuxt project like: pnpm dlx nuxi@latest init demo-project
  2. install element-ui/nuxt,by using command: npx nuxi@latest module add element-plus
  3. add to nuxt.config.ts: export default defineNuxtConfig({ modules: [ '@element-plus/nuxt' ], ...other code})
  4. F12 open console and see this error image
tolking commented 1 month ago

If you are using pnpm, you may need to add an additional file. refer to

// .npmrc

shamefully-hoist=true

then pnpm i