vite-ssg
vite-ssg copied to clipboard
CommonJS modules can always be imported via the default export
Describe the bug
import Antd, { Button, Dropdown, Menu, MenuItem, Layout, LayoutContent, Spin, Tooltip, Tag, Divider, Empty, Pagination } from "ant-design-vue/es/index.js"; ^^^^^^ SyntaxError: Named export 'Button' not found. The requested module 'ant-design-vue/es/index.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 'ant-design-vue/es/index.js'; const { Button, Dropdown, Menu, MenuItem, Layout, LayoutContent, Spin, Tooltip, Tag, Divider, Empty, Pagination } = pkg;
at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)
Node.js v18.14.0
Reproduction
error
System Info
error
Used Package Manager
npm
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.
Do you have any solutions to this problem
我也遇到了类似的问题。