|
|
--- |
|
|
title: Conflicting SSG Paths |
|
|
--- |
|
|
|
|
|
|
|
|
|
|
|
You returned **conflicting paths** in your `getStaticPaths` function for one of your pages. All page paths must be unique and duplicates are not allowed. |
|
|
|
|
|
|
|
|
|
|
|
Remove any conflicting paths shown in the error message and only return them from one `getStaticPaths`. |
|
|
|
|
|
Example conflicting paths: |
|
|
|
|
|
```jsx filename="pages/hello/world.js" |
|
|
export default function Hello() { |
|
|
return 'hello world!' |
|
|
} |
|
|
``` |
|
|
|
|
|
```jsx filename="pages/[...catchAll].js" |
|
|
export const getStaticProps = () => ({ props: {} }) |
|
|
|
|
|
export const getStaticPaths = () => ({ |
|
|
paths: [ |
|
|
'/hello/world', |
|
|
'/another', |
|
|
], |
|
|
fallback: false, |
|
|
}) |
|
|
|
|
|
export default function CatchAllPage() { |
|
|
return 'Catch-all page' |
|
|
} |
|
|
``` |
|
|
|
|
|
Example conflicting paths: |
|
|
|
|
|
```jsx filename="pages/blog/[slug].js" |
|
|
export const getStaticPaths = () => ({ |
|
|
paths: ['/blog/conflicting', '/blog/another'], |
|
|
fallback: false, |
|
|
}) |
|
|
|
|
|
export default function Blog() { |
|
|
return 'Blog!' |
|
|
} |
|
|
``` |
|
|
|
|
|
```jsx filename="pages/[...catchAll].js" |
|
|
export const getStaticProps = () => ({ props: {} }) |
|
|
|
|
|
export const getStaticPaths = () => ({ |
|
|
paths: [ |
|
|
|
|
|
'/blog/conflicting', |
|
|
'/another', |
|
|
], |
|
|
fallback: false, |
|
|
}) |
|
|
|
|
|
export default function CatchAll() { |
|
|
return 'Catch-all page' |
|
|
} |
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
- [`getStaticPaths` Documentation](/docs/pages/building-your-application/data-fetching/get-static-paths) |
|
|
|