vercel/next.js · error

${getDisplayName(App)} returned an empty object from `getIni

Error message

${getDisplayName(App)} returned an empty object from `getInitialProps`. This de-optimizes and prevents automatic static optimization. https://nextjs.org/docs/messages/empty-object-getInitialProps

What it means

Error "${getDisplayName(App)} returned an empty object from `getInitialProps`. This de-optimizes and prevents automatic static optimization. https://nextjs.org/docs/messages/empty-object-getInitialProps" thrown in vercel/next.js.

Source

Thrown at packages/next/src/shared/lib/utils.ts:414

    return {} as IP
  }

  const props = await App.getInitialProps(ctx)

  if (res && isResSent(res)) {
    return props
  }

  if (!props) {
    const message = `"${getDisplayName(
      App
    )}.getInitialProps()" should resolve to an object. But found "${props}" instead.`
    throw new Error(message)
  }

  if (process.env.NODE_ENV !== 'production') {
    if (Object.keys(props).length === 0 && !ctx.ctx) {
      console.warn(
        `${getDisplayName(
          App
        )} returned an empty object from \`getInitialProps\`. This de-optimizes and prevents automatic static optimization. https://nextjs.org/docs/messages/empty-object-getInitialProps`
      )
    }
  }

  return props
}

export const SP = typeof performance !== 'undefined'
export const ST =
  SP &&
  (['mark', 'measure', 'getEntriesByName'] as const).every(
    (method) => typeof performance[method] === 'function'
  )

export class DecodeError extends Error {}

View on GitHub (pinned to 89d017eac4)

Solutions

  1. Remove `getInitialProps` from _app if it returns an empty object, so automatic static optimization is not disabled.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/next/src/shared/lib/utils.ts:415 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of vercel/next.js@89d017eac4 (2026-08-19). Data as JSON: /api/errors/e18a679cf0e3b94b. Report an issue: GitHub.