invalid-page-config.mdx
title: Invalid Page / API Route Config
Why This Error Occurred
In one of your pages or API Routes, you used export const config with an invalid value.
Possible Ways to Fix It
- The page's
configmust be an object initialized directly when being exported and not modified dynamically. - The
configobject must only contain static constant literals without expressions.
// `config` should be an object
export const config = 'hello world'
</td>
<td>
export const config = {}
</td>
</tr>
<tr>
<td>
// `config.runtime` contains a dynamic expression
export const config = {
runtime: `node${'js'}`,
}
</td>
<td>
export const config = {
runtime: 'nodejs',
}
export const config = {
runtime: `edge`,
}
</td>
</tr>
<tr>
<td>
// Re-exported `config` is not allowed
export { config } from '../config'
</td>
<td>
export const config = {}
</td>
</tr>
</tbody>
</table>
Useful Links
Rendered from the public repository vercel/next.js on GitHub; content belongs to its authors. Cached for up to an hour.