# 错误：无效的段配置导出。只允许 'dynamic', 'dynamicParams', 'revalidate', 'fetchCache', 'runtime', 'preferredRegion', 'maxDuration'。

- **ID:** `nextjs/invalid-segment-config-export`
- **领域:** nextjs
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 90%

## 根因

页面或布局导出了一个包含不受支持的键的配置对象（例如，将 'generateStaticParams' 作为配置键而不是函数，或拼写错误的配置名称）。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| Next.js 13.x | active | — | — |
| Next.js 14.x | active | — | — |
| Next.js 15.x | active | — | — |

## 解决方案

1. ```
   Check the exported config object for any keys not in the allowed list. Remove or correct them. Ensure generateStaticParams is exported as a separate function, not inside the config.
   ```
2. ```
   Use the official Next.js segment config documentation to verify allowed keys and correct spelling. If using TypeScript, define the config with a typed interface to catch errors at compile time.
   ```

## 无效尝试

- **** — generateStaticParams is a separate exported function, not a config key. It must be exported directly from the page file. (80% 失败率)
- **** — Even if the key is valid, the value must be supported; 'edge' requires specific configuration and may not be available in all deployments. (50% 失败率)
- **** — The framework validates config keys strictly; any unrecognized key triggers this error. (90% 失败率)
