element-plus-nuxt icon indicating copy to clipboard operation
element-plus-nuxt copied to clipboard

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

Open vcc0827 opened this issue 1 year ago • 2 comments

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

vcc0827 avatar Aug 13 '24 08:08 vcc0827

Can you provide a minimal example?

tolking avatar Aug 13 '24 13:08 tolking

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

vcc0827 avatar Aug 14 '24 06:08 vcc0827

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

// .npmrc

shamefully-hoist=true

then pnpm i

tolking avatar Aug 22 '24 02:08 tolking

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

// .npmrc

shamefully-hoist=true

then pnpm i

不起作用,依旧报错

hucoooo avatar Oct 18 '24 06:10 hucoooo

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

shamefully-hoist=true

then pnpm i

不起作用,依旧报错

要删除pnpm-lock.yaml和node_modules重新执行pnpm i

hucoooo avatar Oct 18 '24 06:10 hucoooo