When defining custom routes an array wasn't returned from either headers
, rewrites
, or redirects
.
Make sure to return an array that contains the routes.
Before
// next.config.js
module.exports = {
async rewrites() {
return {
source: '/feedback',
destination: '/feedback/general',
}
},
}
After
module.exports = {
async rewrites() {
return [
{
source: '/feedback',
destination: '/feedback/general',
},
]
},
}