# Next.js: Error: You cannot use different slug names for the same dynamic path ('id' !== 'slug')

**Code:** `You cannot use different slug names for the same dynamic path` · **Category:** Next.js · **Seen on:** Next.js

Sibling dynamic folders at the same level use different parameter names.

## Meaning

At one path level only one dynamic segment name is allowed: `[id]` and `[slug]` can't coexist. Rename them to the same name, nest them differently, or merge routes. After renaming restart `next dev` and clear `.next`.

## Common causes

- `app/posts/[id]` and `app/posts/[slug]` both present
- Pages and app routes with different names for the same segment
- Leftover renamed folder
- Catch-all conflicts
- Copy-paste folder

## Quick fix

1. Rename to a single consistent param name
2. Remove the stale folder
3. Restart dev server and delete `.next`

## Detailed fix by platform

### Linux

1. `rm -rf .next && npm run dev` after renaming folders

## How to diagnose

1. **Folders** — Both [id] and [slug]?
2. **Level** — Same parent?
3. **Cache** — .next cleared?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/nextjs/dynamic-route-different-slug-names)
