# 尝试导入错误：'ComponentName' 未从 './module' 中导出

- **ID:** `react/missing-export-default-component`
- **领域:** react
- **类别:** module_error
- **验证级别:** ai_generated
- **修复率:** 92%

## 根因

导入语句中引用的组件或函数要么未导出，要么以默认方式导出但作为命名导入，或者文件路径错误。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| webpack 5.88.0 | active | — | — |
| create-react-app 5.0.1 | active | — | — |
| vite 4.4.0 | active | — | — |

## 解决方案

1. ```
   Check the export statement in the module file. If it uses 'export default ComponentName', use default import: 'import ComponentName from "./module"'. If it uses 'export { ComponentName }', use named import: 'import { ComponentName } from "./module"'.
   ```
2. ```
   Verify the file path relative to the importing file. Use './' for same directory, '../' for parent. Ensure file extension is omitted or correct (webpack handles .js/.jsx/.ts/.tsx).
   ```

## 无效尝试

- **** — The error is static; restarting doesn't change the module's export statements. (95% 失败率)
- **** — If the import uses named syntax, adding default export doesn't fix it; may cause export ambiguity. (80% 失败率)
