44d1a1cb15
This PR is part of a larger effort to migrate error messages to MDX and use App Router: https://github.com/vercel/front/pull/23459
39 lines
651 B
Text
39 lines
651 B
Text
---
|
|
title: Custom Routes must return an array
|
|
---
|
|
|
|
## Why This Error Occurred
|
|
|
|
When defining custom routes an array wasn't returned from either `headers`, `rewrites`, or `redirects`.
|
|
|
|
## Possible Ways to Fix It
|
|
|
|
Make sure to return an array that contains the routes.
|
|
|
|
**Before**
|
|
|
|
```js filename="next.config.js"
|
|
module.exports = {
|
|
async rewrites() {
|
|
return {
|
|
source: '/feedback',
|
|
destination: '/feedback/general',
|
|
}
|
|
},
|
|
}
|
|
```
|
|
|
|
**After**
|
|
|
|
```js filename="next.config.js"
|
|
module.exports = {
|
|
async rewrites() {
|
|
return [
|
|
{
|
|
source: '/feedback',
|
|
destination: '/feedback/general',
|
|
},
|
|
]
|
|
},
|
|
}
|
|
```
|