Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined.
Check the render method of `HomeView`.
在优化 HomeView 和 Sidebar 时,使用了不存在的图标:
IconClipboardList - 不存在IconTag - 不存在查看 web/libs/ui/src/assets/icons/index.ts 找到正确的图标名称:
import { IconFolder, IconClipboardList, IconTag } from '@humansignal/ui';
import { IconFolder, IconClipboardCheck, IconAnnotation } from '@humansignal/ui';
| 用途 | 错误的图标 | 正确的图标 |
|---|---|---|
| 任务管理 | IconClipboardList |
IconClipboardCheck |
| 我的标注 | IconTag |
IconAnnotation |
| 项目管理 | IconFolder |
IconFolder ✅ |
web/apps/lq_label/src/views/home-view.tsx
web/apps/lq_label/src/components/layout/sidebar.tsx
查看图标索引文件:
web/libs/ui/src/assets/icons/index.ts
搜索相关关键词:
# 搜索包含 "clipboard" 的图标
grep -i "clipboard" web/libs/ui/src/assets/icons/index.ts
# 搜索包含 "annotation" 的图标
grep -i "annotation" web/libs/ui/src/assets/icons/index.ts
常用图标列表:
IconFolder - 文件夹IconClipboardCheck - 剪贴板/任务IconAnnotation - 标注IconHome - 首页IconMenu - 菜单IconX / IconClose - 关闭IconCheck - 勾选IconTrash - 删除IconEdit / IconPencil - 编辑IconPlus - 添加IconSearch - 搜索IconSettings / IconGear - 设置检查编译错误:
yarn nx serve lq_label
检查浏览器控制台是否有错误
确认图标正确显示在页面上
修复后,所有图标都能正确导入和显示:
记住:在使用 @humansignal/ui 的图标前,先检查 icons/index.ts 确认图标是否存在!