# Error: Invalid segment config export. Only 'dynamic', 'dynamicParams', 'revalidate', 'fetchCache', 'runtime', 'preferredRegion', 'maxDuration' are allowed.

- **ID:** `nextjs/invalid-segment-config-export`
- **Domain:** nextjs
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

A page or layout exports a config object with an unsupported key (e.g., 'generateStaticParams' as a config key instead of a function, or a misspelled config name).

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Next.js 13.x | active | — | — |
| Next.js 14.x | active | — | — |
| Next.js 15.x | active | — | — |

## Workarounds

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.** (95% success)
   ```
   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.** (90% success)
   ```
   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.
   ```

## Dead Ends

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