# 错误：路径 '/[slug]' 的静态生成在 60 秒后超时。考虑增加静态生成超时时间。

- **ID:** `nextjs/static-generation-timeout-slug`
- **领域:** nextjs
- **类别:** build_error
- **验证级别:** ai_generated
- **修复率:** 75%

## 根因

在静态生成期间（例如，使用 `output: export` 或 `generateStaticParams`），页面渲染时间超过默认的 60 秒超时，通常由于数据获取缓慢或计算量大。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| Next.js 13.3+ | active | — | — |
| Next.js 14.0 | active | — | — |
| Next.js 15.0 | active | — | — |

## 解决方案

1. ```
   Increase the timeout in next.config.js: `module.exports = { staticGenerationTimeout: 120 }`
   ```
2. ```
   Optimize data fetching in the page: use caching, limit the number of items in `generateStaticParams`, or use incremental static regeneration.
   ```

## 无效尝试

- **** — This prevents static generation entirely, but if the project requires static export (`output: export`), dynamic rendering is not allowed. (70% 失败率)
- **** — It only masks the issue; if the underlying cause (slow data fetch) isn't fixed, builds become unreasonably long. (50% 失败率)
- **** — Breaking change: without it, dynamic routes won't be pre-rendered for static export, causing build failures. (85% 失败率)
