# 错误：插槽 '@slot' 缺少必需的 'default.tsx' 文件。请确保插槽有默认导出。

- **ID:** `nextjs/parallel-route-slot-not-found`
- **领域:** nextjs
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 95%

## 根因

app 目录中的并行路由插槽必须有一个 default.tsx 文件，以便在找不到匹配路由时渲染；否则 Next.js 会抛出此错误以强制回退行为。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| Next.js 14.0.0 | active | — | — |
| Next.js 14.1.0 | active | — | — |
| Next.js 14.2.0 | active | — | — |

## 解决方案

1. ```
   Create a default.tsx file in the slot directory that exports a default component, e.g., 'export default function Default() { return null; }'
   ```
2. ```
   Use a catch-all route like '[[...slug]]' inside the slot folder with a page.tsx that handles all unmatched paths, but still ensure default.tsx exists for the slot root.
   ```
3. ```
   If the slot is not needed, remove all references to it from layout.tsx and delete the slot folder.
   ```

## 无效尝试

- **** — Layout.tsx is used for shared layouts, not as a fallback render for unmatched routes; the slot still needs default.tsx. (70% 失败率)
- **** — Removing the slot breaks the parallel route structure; use default.tsx to keep the slot functional. (90% 失败率)
- **** — Page.tsx only works for the root segment of the slot; default.tsx is specifically required for fallback rendering. (80% 失败率)
