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

不支持vite5.0 #7957

Open
1 task
Panmy668 opened this issue Nov 28, 2024 · 2 comments
Open
1 task

不支持vite5.0 #7957

Panmy668 opened this issue Nov 28, 2024 · 2 comments

Comments

@Panmy668
Copy link

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

4.2.6

Environment

vue 3.4.27、chrome131.0.6778.86

Reproduction link

https://github.com/vueComponent/ant-design-vue/blob/4a37016f4e3f829838b2e2b3cd128af220d67be8/components/theme/convertLegacyToken.ts

Steps to reproduce

vue 3.4.27,vite 5.3.5版本直接提示不支持CMJ 模式

failed to load config from /jnpfsoft-jnpf-jnpf-web-vue3-mock/vite.config.mts
error when starting dev server:
file:///jnpfsoft-jnpf-jnpf-web-vue3-mock/vite.config.mts.timestamp-1732765296557-595293d244146.mjs:255
import { convertLegacyToken } from "file:///jnpfsoft-jnpf-jnpf-web-vue3-mock/node_modules/.pnpm/ant-design-vue@4.2.6_vue@3.5.13/node_modules/ant-design-vue/lib/theme/convertLegacyToken.js";
^^^^^^^^^^^^^^^^^^
SyntaxError: Named export 'convertLegacyToken' not found. The requested module 'file:///jnpfsoft-jnpf-jnpf-web-vue3-mock/node_modules/.pnpm/ant-design-vue@4.2.6_vue@3.5.13/node_modules/ant-design-vue/lib/theme/convertLegacyToken.js' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'file:///jnpfsoft-jnpf-jnpf-web-vue3-mock/node_modules/.pnpm/ant-design-vue@4.2.6_vue@3.5.13/node_modules/ant-design-vue/lib/theme/convertLegacyToken.js';
const { convertLegacyToken } = pkg;

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:530:24)
at async loadConfigFromBundledFile (file:///jnpfsoft-jnpf-jnpf-web-vue3-mock/node_modules/.pnpm/vite@5.3.5_@types+node@18.19.66_less@4.2.1_terser@5.36.0/node_modules/vite/dist/node/chunks/dep-mCdpKltl.js:66365:15)
at async loadConfigFromFile (file:///jnpfsoft-jnpf-jnpf-web-vue3-mock/node_modules/.pnpm/vite@5.3.5_@types+node@18.19.66_less@4.2.1_terser@5.36.0/node_modules/vite/dist/node/chunks/dep-mCdpKltl.js:66206:24)
at async resolveConfig (file:///jnpfsoft-jnpf-jnpf-web-vue3-mock/node_modules/.pnpm/vite@5.3.5_@types+node@18.19.66_less@4.2.1_terser@5.36.0/node_modules/vite/dist/node/chunks/dep-mCdpKltl.js:65816:24)
at async _createServer (file:///jnpfsoft-jnpf-jnpf-web-vue3-mock/node_modules/.pnpm/vite@5.3.5_@types+node@18.19.66_less@4.2.1_terser@5.36.0/node_modules/vite/dist/node/chunks/dep-mCdpKltl.js:62432:18)
at async CAC.<anonymous> (file:///jnpfsoft-jnpf-jnpf-web-vue3-mock/node_modules/.pnpm/vite@5.3.5_@types+node@18.19.66_less@4.2.1_terser@5.36.0/node_modules/vite/dist/node/cli.js:735:20)

What is expected?

希望ant design vue能支持vite5.0

What is actually happening?

vite 5.0 开始不支持cmj模式

@Roywhite
Copy link

使用的vue@3.5.12,vite@5.4.9,antdv@4.2.6,没有出现这个问题

@xinmiti
Copy link

xinmiti commented Dec 16, 2024

vue@3.5.13 vite@6.0.2 ant-design-vue@4.2.6没有问题

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