# Error: Route "[param]" has invalid parameter type. Parameters must be strings or arrays of strings, but received number.

- **ID:** `nextjs/invalid-app-path-param-type`
- **Domain:** nextjs
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

In dynamic routes (e.g., app/[slug]/page.tsx), the generateStaticParams function or the params object from the route returns a non-string value (e.g., number) for a parameter that Next.js expects to be a string.

## Version Compatibility

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

## Workarounds

1. **Ensure generateStaticParams returns params as strings. Use String() or template literals to convert numbers.** (95% success)
   ```
   Ensure generateStaticParams returns params as strings. Use String() or template literals to convert numbers.
   ```
2. **Add TypeScript validation to ensure params are strings. Use a type guard or runtime check in the page component.** (90% success)
   ```
   Add TypeScript validation to ensure params are strings. Use a type guard or runtime check in the page component.
   ```

## Dead Ends

- **** — Next.js requires params to be strings for URL construction; numbers cause type errors. (90% fail)
- **** — TypeScript and runtime validation will throw an error if the value is not a string or array of strings. (60% fail)
- **** — The build will fail (if using static generation) or the route will not match correctly at runtime. (80% fail)
