unplugin-auto-import
unplugin-auto-import copied to clipboard
在astro 里面使用的时候会报 module 'ant-design-vue/es/index.js' is a CommonJS module,
Describe the bug

Reproduction
bug
System Info
/* empty css *//* empty css */import { Table, Form, FormItem, Input, DatePicker, Select, SelectOption, Textarea, UploadDragger, Button, Checkbox } 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 { Table, Form, FormItem, Input, DatePicker, Select, SelectOption, Textarea, UploadDragger, Button, Checkbox } = pkg;
at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)
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.