ant-design / ant-design-icons

⭐ Ant Design SVG Icons
https://ant.design/components/icon/
MIT License
939 stars 577 forks source link

无法在 vite 和 remix 中使用 #638

Closed hungtcs closed 3 months ago

hungtcs commented 3 months ago

Vite 仍然识别为 commonjs 模块

10:06:31 AM [vite] Internal server error: [vite] Named export 'SearchOutlined' not found. The requested module '@ant-design/icons' 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/icons';
const {PlusOutlined, SearchOutlined} = pkg;

环境信息

System:
    OS: macOS 14.3.1
    CPU: (8) arm64 Apple M3
    Memory: 1.64 GB / 24.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.11.1 - ~/Library/Caches/fnm_multishells/6443_1711935576953/bin/node
    npm: 10.2.4 - ~/Library/Caches/fnm_multishells/6443_1711935576953/bin/npm
    pnpm: 8.15.3 - ~/Library/Caches/fnm_multishells/1364_1711932698803/bin/pnpm
  Browsers:
    Chrome: 123.0.6312.87
    Safari: 17.3.1
  npmPackages:
    vite: ^5.2.7 => 5.2.7

相关 Issues

ref #477 duplicate #605

afc163 commented 3 months ago

来个 PR?

hungtcs commented 3 months ago

@afc163 我目前还正在调试,这个问题是我升级 antd 后出现的,等我弄清楚具体原因哈

afc163 commented 3 months ago

@hungtcs 辛苦啦

hungtcs commented 3 months ago

@afc163 我发现 es/icons 里面的所有文件都没有生成类型声明,但是不知道怎么排查。

image
hungtcs commented 3 months ago

Duplicate https://github.com/ant-design/ant-design-icons/issues/605