{"record":{"id":"b0516cebbe1b0d64","repo":"vercel/next.js","slug":"specified-pageextensions-is-not-an-array-of-string","errorCode":null,"errorMessage":"Specified pageExtensions is not an array of strings, found \"${value}\". Please update this config or remove it.","messagePattern":"Specified pageExtensions is not an array of strings, found \"(.+?)\"\\. Please update this config or remove it\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/next/src/server/config.ts","lineNumber":404,"sourceCode":"        // don't allow public as the distDir as this is a reserved folder for\n        // public files\n        if (userDistDir === 'public') {\n          throw new Error(\n            `The 'public' directory is reserved in Next.js and can not be set as the 'distDir'. https://nextjs.org/docs/messages/can-not-output-to-public`\n          )\n        }\n        // make sure distDir isn't an empty string as it can result in the provided\n        // directory being deleted in development mode\n        if (userDistDir.length === 0) {\n          throw new Error(\n            `Invalid distDir provided, distDir can not be an empty string. Please remove this config or set it to undefined`\n          )\n        }\n      }\n\n      if (key === 'pageExtensions') {\n        if (!Array.isArray(value)) {\n          throw new Error(\n            `Specified pageExtensions is not an array of strings, found \"${value}\". Please update this config or remove it.`\n          )\n        }\n\n        if (!value.length) {\n          throw new Error(\n            `Specified pageExtensions is an empty array. Please update it with the relevant extensions or remove it.`\n          )\n        }\n\n        value.forEach((ext) => {\n          if (typeof ext !== 'string') {\n            throw new Error(\n              `Specified pageExtensions is not an array of strings, found \"${ext}\" of type \"${typeof ext}\". Please update this config or remove it.`\n            )\n          }\n        })\n      }","sourceCodeStart":386,"sourceCodeEnd":422,"githubUrl":"https://github.com/vercel/next.js/blob/34433fd12ee8074ea3f47af9f36255c7390d0301/packages/next/src/server/config.ts#L386-L422","documentation":"Config validation in assignDefaultsAndValidate: the pageExtensions key was checked with Array.isArray and failed — it is not an array. Page extensions must be a list of file-extension strings (e.g. ['tsx','ts','js']); the received value is echoed in the error so the next.config.js entry can be fixed or removed.","triggerScenarios":"pageExtensions is not an array of strings.","commonSituations":"Passing a string or other type as pageExtensions in next.config.","solutions":["Set pageExtensions to an array of strings, e.g. ['tsx','ts','jsx','js']."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"34433fd12ee8074ea3f47af9f36255c7390d0301","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}