unplugin-vue-components
unplugin-vue-components copied to clipboard
in vitesse project,use antd build error
Describe the bug
Components({
// allow auto load markdown components under ./src/components/
extensions: ['vue', 'md'],
// allow auto import and register components used in markdown
include: [/.vue$/, /.vue?vue/, /.md$/],
dts: 'src/components.d.ts',
resolvers: [
AntDesignVueResolver({
cjs: false,
resolveIcons: true,
importCss: true,
}),
ElementPlusResolver(),
VantResolver(),
],
}),
run:vite-ssg build
✓ 295 modules transformed. .vite-ssg-temp/manifest.webmanifest 0.37 KiB .vite-ssg-temp/assets/style.4299fff2.css 57.65 KiB .vite-ssg-temp/main.cjs 2488.95 KiB TIM 22:54:16.721:TIM.VERSION: 2.20.1
[vite-ssg] An internal error occurred. [vite-ssg] Please report an issue, if none already exists: https://github.com/antfu/vite-ssg/issues node:internal/modules/cjs/loader:946 const err = new Error(message); ^
Error: Cannot find module 'ant-design-vue/es.js' Require stack:
- /Users/jerry/Desktop/Project/vite-ssg-temp/main.cjs
- /Users/jerry/Desktop/Project/node_modules/.pnpm/[email protected]_5khqchknxzwdw7k7kgjhvymlwa/node_modules/vite-ssg/dist/chunks/build.mjs
at Module._resolveFilename (node:internal/modules/cjs/loader:946:15)
at Module._load (node:internal/modules/cjs/loader:787:27)
at Module.require (node:internal/modules/cjs/loader:1012:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Module.
(/Users/jerry/Desktop/Project/.vite-ssg-temp/main.cjs:12:15) at Module._compile (node:internal/modules/cjs/loader:1112:14) at Module._extensions..js (node:internal/modules/cjs/loader:1166:10) at Module.load (node:internal/modules/cjs/loader:988:32) at Module._load (node:internal/modules/cjs/loader:834:12) at Module.require (node:internal/modules/cjs/loader:1012:19) { code: 'MODULE_NOT_FOUND', requireStack: [ '/Users/jerry/Desktop/Project/.vite-ssg-temp/main.cjs', '/Users/jerry/Desktop/Project/node_modules/.pnpm/[email protected]_5khqchknxzwdw7k7kgjhvymlwa/node_modules/vite-ssg/dist/chunks/build.mjs' ] }
Node.js v18.4.0 ELIFECYCLE Command failed with exit code 1.
"dependencies": { "@ant-design/icons-vue": "^6.1.0", "@vercel/ncc": "0.32.0", "@vue/compiler-sfc": "^3.2.37", "@vue/server-renderer": "^3.2.37", "@vueuse/core": "^8.9.4", "@vueuse/head": "^0.7.6", "ant-design-vue": "^3.2.10", "axios": "^0.27.2", "clipboard": "^2.0.11", "crypto-js": "^4.1.1", "element-plus": "^2.2.10", "esbuild": "^0.13.15", "mitt": "^3.0.0", "nprogress": "^0.2.0", "pinia": "^2.0.16", "prism-theme-vars": "^0.2.4", "sass-loader": "^13.0.2", "tim-js-sdk": "^2.20.1", "vant": "^3.6.1", "vite-plugin-ssr": "0.4.5", "vue": "^3.2.37", "vue-demi": "^0.13.5", "vue-i18n": "^9.1.10", "vue-recaptcha-v3": "^2.0.1", "vue-router": "^4.1.2", "vue3-lottie": "^2.2.5" }, "devDependencies": { "@antfu/eslint-config": "^0.25.2", "@iconify-json/carbon": "^1.1.6", "@intlify/vite-plugin-vue-i18n": "^4.0.0", "@types/markdown-it-link-attributes": "^3.0.1", "@types/nprogress": "^0.2.0", "@vitejs/plugin-vue": "^2.3.3", "@vue/test-utils": "^2.0.2", "critters": "^0.0.16", "cross-env": "^7.0.3", "cypress": "^9.7.0", "eslint": "^8.20.0", "eslint-plugin-cypress": "^2.12.1", "https-localhost": "^4.7.1", "localize-with-spreadsheet-pro": "^1.0.3", "markdown-it-link-attributes": "^4.0.0", "markdown-it-prism": "^2.2.4", "pnpm": "^7.5.2", "postcss-px-to-viewport": "^1.1.1", "sass": "^1.53.0", "typescript": "^4.7.4", "unocss": "^0.39.3", "unplugin-auto-import": "^0.8.8", "unplugin-vue-components": "^0.22.7", "vite": "^3.0.2", "vite-plugin-html-env": "^1.2.2", "vite-plugin-inspect": "^0.5.1", "vite-plugin-md": "^0.14.2", "vite-plugin-pages": "^0.24.3", "vite-plugin-pwa": "^0.12.3", "vite-plugin-vue-layouts": "^0.6.0", "vite-ssg": "^0.20.2", "vitest": "^0.14.2", "vue-tsc": "^0.37.9" }
Reproduction
Reproduction
System Info
System Info
Used Package Manager
pnpm
Validations
- [X] Follow our Code of Conduct
- [X] Read the Contributing Guide.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
- [X] The provided reproduction is a minimal reproducible of the bug.
AntDesignVueResolver.cjs true or false, this are same error Please help me, we project is online, boss day day say fuck~!
No reproduction + broken English :(
I have the same problem, both CJS and MJS report errors.you solved it?Please help me💔