element-plus-nuxt
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)
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)
Can you provide a minimal example?
Can you provide a minimal example?
- using command build a nuxt project like: pnpm dlx nuxi@latest init demo-project
- install element-ui/nuxt,by using command: npx nuxi@latest module add element-plus
- add to nuxt.config.ts: export default defineNuxtConfig({ modules: [ '@element-plus/nuxt' ], ...other code})
- F12 open console and see this error
If you are using pnpm, you may need to add an additional file. refer to
// .npmrc
shamefully-hoist=true
then pnpm i
If you are using pnpm, you may need to add an additional file. refer to
// .npmrc
shamefully-hoist=truethen
pnpm i
不起作用,依旧报错
If you are using pnpm, you may need to add an additional file. refer to // .npmrc
shamefully-hoist=truethen
pnpm i不起作用,依旧报错
要删除pnpm-lock.yaml和node_modules重新执行pnpm i