rsnext/errors/invalid-page-config.md
Kevin Mårtensson aa4b87e357
Handle cases where config is exported after its declaration (#16211)
AMP will still not work correctly when switching between non-AMP and AMP pages in development mode because of https://github.com/vercel/next.js/blob/canary/packages/next/build/babel/plugins/next-page-config.ts#L116-L120.

Fixes #15704.
2020-08-17 17:24:18 +00:00

716 B

Invalid Page Config

Why This Error Occurred

In one of your pages 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.

This is not allowed

export const config = 'hello world'

This is not allowed

const config = {}
config.amp = true

This is not allowed

export { config } from '../config'

This is allowed

export const config = { amp: true }