2023-07-05 15:11:16 +02:00
---
title: Conflicting SSG Paths
---
2021-01-11 21:50:17 +01:00
2023-07-05 15:11:16 +02:00
## Why This Error Occurred
2021-01-11 21:50:17 +01:00
2023-07-05 15:11:16 +02:00
You returned **conflicting paths** in your `getStaticPaths` function for one of your pages. All page paths must be unique and duplicates are not allowed.
2021-01-11 21:50:17 +01:00
2023-07-05 15:11:16 +02:00
## Possible Ways to Fix It
2021-01-11 21:50:17 +01:00
Remove any conflicting paths shown in the error message and only return them from one `getStaticPaths`.
Example conflicting paths:
2023-07-05 15:11:16 +02:00
```jsx filename="pages/hello/world.js"
2021-01-11 21:50:17 +01:00
export default function Hello() {
return 'hello world!'
}
2023-07-05 15:11:16 +02:00
```
2021-01-11 21:50:17 +01:00
2023-07-05 15:11:16 +02:00
```jsx filename="pages/[...catchAll].js"
2021-01-11 21:50:17 +01:00
export const getStaticProps = () => ({ props: {} })
export const getStaticPaths = () => ({
paths: [
2023-07-05 15:11:16 +02:00
'/hello/world', // <-- this conflicts with the /hello/world.js page, remove to resolve error
2021-01-11 21:50:17 +01:00
'/another',
],
fallback: false,
})
2023-07-05 15:11:16 +02:00
export default function CatchAllPage() {
2021-01-11 21:50:17 +01:00
return 'Catch-all page'
}
```
Example conflicting paths:
2023-07-05 15:11:16 +02:00
```jsx filename="pages/blog/[slug].js"
2021-01-11 21:50:17 +01:00
export const getStaticPaths = () => ({
paths: ['/blog/conflicting', '/blog/another'],
fallback: false,
})
export default function Blog() {
return 'Blog!'
}
2023-07-05 15:11:16 +02:00
```
2021-01-11 21:50:17 +01:00
2023-07-05 15:11:16 +02:00
```jsx filename="pages/[...catchAll].js"
2021-01-11 21:50:17 +01:00
export const getStaticProps = () => ({ props: {} })
export const getStaticPaths = () => ({
paths: [
// this conflicts with the /blog/conflicting path above, remove to resolve error
'/blog/conflicting',
'/another',
],
fallback: false,
})
export default function CatchAll() {
return 'Catch-all page'
}
```
2023-07-05 15:11:16 +02:00
## Useful Links
2021-01-11 21:50:17 +01:00
2023-07-05 15:11:16 +02:00
- [`getStaticPaths` Documentation](/docs/pages/building-your-application/data-fetching/get-static-paths)