# Invalid Page / API Route Config #### Why This Error Occurred In one of your pages or API Routes you did `export const config` with an invalid value. #### Possible Ways to Fix It The page's config must be an object initialized directly when being exported and not modified dynamically. The config object must only contain static constant literals without expressions.
Not Allowed Allowed
```js // `config` should be an object export const config = 'hello world' ``` ```js export const config = {} ```
```js export const config = {} // `config.amp` is defined after `config` is exported config.amp = true // `config.amp` contains a dynamic expression export const config = { amp: 1 + 1 > 2, } ``` ```js export const config = { amp: true, } export const config = { amp: false, } ```
```js // `config.runtime` contains a dynamic expression export const config = { runtime: `node${'js'}`, } ``` ```js export const config = { runtime: 'nodejs', } export const config = { runtime: `nodejs`, } ```
```js // Re-exported `config` is not allowed export { config } from '../config' ``` ```js export const config = {} ```
### Useful Links - [Enabling AMP Support](https://nextjs.org/docs/advanced-features/amp-support/introduction) - [API Routes Request Helpers](https://nextjs.org/docs/api-routes/request-helpers) - [Switchable Runtime](https://nextjs.org/docs/advanced-features/react-18/switchable-runtime)