vercel/next.js · error · Error

Specified pageExtensions is an empty array. Please update…

Error message

Specified pageExtensions is an empty array. Please update it with the relevant extensions or remove it.

What it means

Config validation in assignDefaultsAndValidate: pageExtensions is an array but has zero entries. With no extensions the page-resolution glob matches nothing and every route disappears, so an empty list is rejected with instructions to add the relevant extensions or remove the option to use defaults.

Solutions

  1. Add at least one extension to pageExtensions or remove the option.
Defensive patterns

Strategy: validation

When it happens

Trigger: pageExtensions is configured as an empty array.

Common situations: pageExtensions: [] in next.config leaves no resolvable page extensions.


AI-assisted analysis of vercel/next.js@34433fd12e (2026-08-19). Data as JSON: /api/errors/6198968fbdfa38f5. Report an issue: GitHub.

Appendix: source

Thrown at packages/next/src/server/config.ts:410

        }
        // make sure distDir isn't an empty string as it can result in the provided
        // directory being deleted in development mode
        if (userDistDir.length === 0) {
          throw new Error(
            `Invalid distDir provided, distDir can not be an empty string. Please remove this config or set it to undefined`
          )
        }
      }

      if (key === 'pageExtensions') {
        if (!Array.isArray(value)) {
          throw new Error(
            `Specified pageExtensions is not an array of strings, found "${value}". Please update this config or remove it.`
          )
        }

        if (!value.length) {
          throw new Error(
            `Specified pageExtensions is an empty array. Please update it with the relevant extensions or remove it.`
          )
        }

        value.forEach((ext) => {
          if (typeof ext !== 'string') {
            throw new Error(
              `Specified pageExtensions is not an array of strings, found "${ext}" of type "${typeof ext}". Please update this config or remove it.`
            )
          }
        })
      }

      const defaultValue = (defaultConfig as Record<string, unknown>)[key]

      if (
        !!value &&
        value.constructor === Object &&

View on GitHub (pinned to 34433fd12e)