Skip to content

Latest commit

 

History

History
73 lines (51 loc) · 1.2 KB

invalid-page-config.md

File metadata and controls

73 lines (51 loc) · 1.2 KB

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 contains static constant literals without expressions.

This is not allowed

export const config = 'hello world'

This is not allowed

const config = {}
config.amp = true

This is not allowed

export const config = {
  amp: 1 + 1 > 2,
}

This is not allowed

export { config } from '../config'

This is not allowed

export const config = {
  runtime: `n${'od'}ejs`,
}

This is allowed

export const config = { amp: true }

This is allowed

export const config = {
  runtime: 'nodejs',
}

This is allowed

export const config = {
  runtime: `nodejs`,
}

Useful Links