{"record":{"id":"69106ba5a678a733","repo":"vercel/next.js","slug":"invariant-ppr-cannot-be-enabled-in-export-mode","errorCode":null,"errorMessage":"Invariant: PPR cannot be enabled in export mode","messagePattern":"Invariant: PPR cannot be enabled in export mode","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/next/src/export/index.ts","lineNumber":906,"sourceCode":"\n      // Update not found.\n      if (result.ssgNotFound === true) {\n        collector.ssgNotFoundPaths.add(path)\n      }\n\n      // Update durations.\n      const durations = collector.byPage.get(page) ?? {\n        durationsByPath: new Map<string, number>(),\n      }\n      durations.durationsByPath.set(path, result.duration)\n      collector.byPage.set(page, durations)\n    }\n  }\n\n  // Export mode provide static outputs that are not compatible with PPR mode.\n  if (!options.buildExport && nextConfig.cacheComponents) {\n    // TODO: add message\n    throw new Error('Invariant: PPR cannot be enabled in export mode')\n  }\n\n  // copy prerendered routes to outDir\n  if (!options.buildExport && prerenderManifest) {\n    await Promise.all(\n      Object.keys(prerenderManifest.routes).map(async (unnormalizedRoute) => {\n        // Special handling: map app /_not-found to 404.html (and 404/index.html when trailingSlash)\n        if (unnormalizedRoute === '/_not-found') {\n          const { srcRoute } = prerenderManifest!.routes[unnormalizedRoute]\n          const appPageName = mapAppRouteToPage.get(srcRoute || '')\n          const pageName = appPageName || srcRoute || unnormalizedRoute\n          const isAppPath = Boolean(appPageName)\n          const route = normalizePagePath(unnormalizedRoute)\n\n          const pagePath = getPagePath(pageName, distDir, undefined, isAppPath)\n          const distPagesDir = join(\n            pagePath,\n            pageName","sourceCodeStart":888,"sourceCodeEnd":924,"githubUrl":"https://github.com/vercel/next.js/blob/258b1c1bc05f7099816b88f70b7b3422b24a4b8d/packages/next/src/export/index.ts#L888-L924","documentation":"Invariant thrown in exportAppImpl at the end of a static export: cacheComponents (PPR) is enabled in the config while running next export in non-build-export mode. Static export emits fully static outputs that are incompatible with PPR's partial prerender responses, so the combination is refused outright rather than producing broken output.","triggerScenarios":"PPR is enabled while running in export mode.","commonSituations":"experimental ppr/cacheComponents combined with output: export, an unsupported invariant state.","solutions":["Disable PPR (experimental.ppr / cacheComponents) when using output: export."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"258b1c1bc05f7099816b88f70b7b3422b24a4b8d","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}