2023-07-05 15:11:16 +02:00
|
|
|
---
|
|
|
|
title: The provided export path doesn't match the page.
|
|
|
|
---
|
2019-07-10 23:13:44 +02:00
|
|
|
|
2023-07-05 15:11:16 +02:00
|
|
|
## Why This Error Occurred
|
2019-07-10 23:13:44 +02:00
|
|
|
|
|
|
|
An `exportPathMap` path was improperly matched to a dynamically routed page.
|
|
|
|
This would result in the page missing its URL parameters.
|
|
|
|
|
2023-07-05 15:11:16 +02:00
|
|
|
## Possible Ways to Fix It
|
2019-07-10 23:13:44 +02:00
|
|
|
|
|
|
|
Change your `exportPathMap` function in `next.config.js` to have a path that matches the dynamically routed page.
|
|
|
|
|
2023-07-05 15:11:16 +02:00
|
|
|
```js filename="next.config.js"
|
2019-07-10 23:13:44 +02:00
|
|
|
module.exports = {
|
2020-05-18 21:24:37 +02:00
|
|
|
exportPathMap: function () {
|
2019-07-10 23:13:44 +02:00
|
|
|
return {
|
|
|
|
'/': { page: '/' },
|
|
|
|
// '/blog/nextjs': { page: '/blog/[post]/comment/[id]' }, // wrong
|
|
|
|
'/blog/nextjs/comment/1': { page: '/blog/[post]/comment/[id]' }, // correct
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2023-07-05 15:11:16 +02:00
|
|
|
## Useful Links
|
2019-07-10 23:13:44 +02:00
|
|
|
|
2023-07-05 15:11:16 +02:00
|
|
|
- [exportPathMap](/docs/pages/api-reference/next-config-js/exportPathMap) documentation
|