File size: 1,570 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
---
title: Conflicting SSG Paths
---

## Why This Error Occurred

You returned **conflicting paths** in your `getStaticPaths` function for one of your pages. All page paths must be unique and duplicates are not allowed.

## Possible Ways to Fix It

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', // <-- this conflicts with the /hello/world.js page, remove to resolve error
    '/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: [
    // 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'
}
```

## Useful Links

- [`getStaticPaths` Documentation](/docs/pages/building-your-application/data-fetching/get-static-paths)