# Error: Static generation timed out after 60 seconds for path '/[slug]'. Consider increasing the static generation timeout in next.config.js.

- **ID:** `nextjs/static-generation-timeout-path`
- **Domain:** nextjs
- **Category:** build_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A page using generateStaticParams or static generation (output: 'export' or dynamicParams: false) took longer than the default 60-second timeout to generate all static pages. This is often due to slow data fetching or too many dynamic routes.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Next.js 14.0.0 | active | — | — |
| Next.js 15.0.0 | active | — | — |

## Workarounds

1. **Increase the static generation timeout in next.config.js using the experimental.staticGenerationTimeout option.** (90% success)
   ```
   Increase the static generation timeout in next.config.js using the experimental.staticGenerationTimeout option.
   ```
2. **Optimize generateStaticParams to fetch data more efficiently. Use batch fetching, caching, or limit the number of paths returned.** (85% success)
   ```
   Optimize generateStaticParams to fetch data more efficiently. Use batch fetching, caching, or limit the number of paths returned.
   ```
3. **If using output: 'export', consider switching to partial prerendering or ISR for pages with many dynamic routes. Alternatively, use a custom build script to generate pages in batches.** (75% success)
   ```
   If using output: 'export', consider switching to partial prerendering or ISR for pages with many dynamic routes. Alternatively, use a custom build script to generate pages in batches.
   ```

## Dead Ends

- **Setting dynamicParams: true in the page segment config to allow dynamic rendering for missed routes.** — This only affects runtime behavior for ungenerated routes, not the static generation timeout itself; the timeout still applies to the initial build. (60% fail)
- **Removing generateStaticParams entirely to let Next.js handle all routes dynamically.** — This changes the page to dynamic rendering, which may not be desired for SEO or performance; also, if output: 'export' is set, this will cause a build error. (70% fail)
- **Adding revalidate to the page's fetch calls to enable ISR, thinking it bypasses static generation timeout.** — ISR still requires initial static generation; the timeout applies to the first build, not runtime revalidation. (50% fail)
