Skip to content

不支持vite5.0  #7957

@Panmy668

Description

@Panmy668
  • 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/[email protected][email protected]/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/[email protected][email protected]/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/[email protected][email protected]/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/[email protected]_@[email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-mCdpKltl.js:66365:15)
at async loadConfigFromFile (file:///jnpfsoft-jnpf-jnpf-web-vue3-mock/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-mCdpKltl.js:66206:24)
at async resolveConfig (file:///jnpfsoft-jnpf-jnpf-web-vue3-mock/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-mCdpKltl.js:65816:24)
at async _createServer (file:///jnpfsoft-jnpf-jnpf-web-vue3-mock/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/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/[email protected]_@[email protected][email protected][email protected]/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模式

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions