next 15.6.0-canary.5 → 15.6.0-canary.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/bin/next +1 -1
  2. package/dist/build/index.js +3 -3
  3. package/dist/build/swc/index.js +1 -1
  4. package/dist/build/templates/app-page.js +2 -2
  5. package/dist/build/templates/app-page.js.map +1 -1
  6. package/dist/build/templates/app-route.js +2 -2
  7. package/dist/build/templates/app-route.js.map +1 -1
  8. package/dist/build/templates/edge-ssr-app.js +2 -2
  9. package/dist/build/templates/edge-ssr-app.js.map +1 -1
  10. package/dist/build/templates/edge-ssr.js +2 -2
  11. package/dist/build/templates/edge-ssr.js.map +1 -1
  12. package/dist/build/templates/pages-api.js +2 -2
  13. package/dist/build/templates/pages-api.js.map +1 -1
  14. package/dist/build/webpack-config.js +2 -2
  15. package/dist/client/app-bootstrap.js +1 -1
  16. package/dist/client/index.js +1 -1
  17. package/dist/compiled/next-server/pages-api-turbo.runtime.prod.js +1 -1
  18. package/dist/compiled/next-server/pages-api-turbo.runtime.prod.js.map +1 -1
  19. package/dist/compiled/next-server/pages-api.runtime.dev.js +1 -1
  20. package/dist/compiled/next-server/pages-api.runtime.dev.js.map +1 -1
  21. package/dist/compiled/next-server/pages-api.runtime.prod.js +1 -1
  22. package/dist/compiled/next-server/pages-api.runtime.prod.js.map +1 -1
  23. package/dist/compiled/next-server/pages-turbo.runtime.prod.js +1 -1
  24. package/dist/compiled/next-server/pages-turbo.runtime.prod.js.map +1 -1
  25. package/dist/compiled/next-server/pages.runtime.dev.js +1 -1
  26. package/dist/compiled/next-server/pages.runtime.dev.js.map +1 -1
  27. package/dist/compiled/next-server/pages.runtime.prod.js +1 -1
  28. package/dist/compiled/next-server/pages.runtime.prod.js.map +1 -1
  29. package/dist/compiled/next-server/server.runtime.prod.js +1 -1
  30. package/dist/compiled/next-server/server.runtime.prod.js.map +1 -1
  31. package/dist/esm/build/index.js +3 -3
  32. package/dist/esm/build/swc/index.js +1 -1
  33. package/dist/esm/build/templates/app-page.js +2 -2
  34. package/dist/esm/build/templates/app-page.js.map +1 -1
  35. package/dist/esm/build/templates/app-route.js +2 -2
  36. package/dist/esm/build/templates/app-route.js.map +1 -1
  37. package/dist/esm/build/templates/edge-ssr-app.js +2 -2
  38. package/dist/esm/build/templates/edge-ssr-app.js.map +1 -1
  39. package/dist/esm/build/templates/edge-ssr.js +2 -2
  40. package/dist/esm/build/templates/edge-ssr.js.map +1 -1
  41. package/dist/esm/build/templates/pages-api.js +2 -2
  42. package/dist/esm/build/templates/pages-api.js.map +1 -1
  43. package/dist/esm/build/webpack-config.js +2 -2
  44. package/dist/esm/client/app-bootstrap.js +1 -1
  45. package/dist/esm/client/index.js +1 -1
  46. package/dist/esm/server/base-server.js +5 -2
  47. package/dist/esm/server/base-server.js.map +1 -1
  48. package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
  49. package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
  50. package/dist/esm/server/lib/app-info-log.js +1 -1
  51. package/dist/esm/server/lib/start-server.js +1 -1
  52. package/dist/esm/server/route-matcher-managers/dev-route-matcher-manager.js +0 -3
  53. package/dist/esm/server/route-matcher-managers/dev-route-matcher-manager.js.map +1 -1
  54. package/dist/esm/shared/lib/canary-only.js +1 -1
  55. package/dist/server/base-server.d.ts +1 -0
  56. package/dist/server/base-server.js +5 -2
  57. package/dist/server/base-server.js.map +1 -1
  58. package/dist/server/dev/hot-reloader-turbopack.js +1 -1
  59. package/dist/server/dev/hot-reloader-webpack.js +1 -1
  60. package/dist/server/lib/app-info-log.js +1 -1
  61. package/dist/server/lib/start-server.js +1 -1
  62. package/dist/server/route-matcher-managers/dev-route-matcher-manager.js +0 -3
  63. package/dist/server/route-matcher-managers/dev-route-matcher-manager.js.map +1 -1
  64. package/dist/shared/lib/canary-only.js +1 -1
  65. package/dist/telemetry/anonymous-meta.js +1 -1
  66. package/dist/telemetry/events/session-stopped.js +2 -2
  67. package/dist/telemetry/events/version.js +2 -2
  68. package/package.json +15 -15
package/dist/bin/next CHANGED
@@ -79,7 +79,7 @@ const program = new NextRootCommand();
79
79
  program.name('next').description('The Next.js CLI allows you to develop, build, start your application, and more.').configureHelp({
80
80
  formatHelp: (cmd, helper)=>(0, _formatclihelpoutput.formatCliHelpOutput)(cmd, helper),
81
81
  subcommandTerm: (cmd)=>`${cmd.name()} ${cmd.usage()}`
82
- }).helpCommand(false).helpOption('-h, --help', 'Displays this message.').version(`Next.js v${"15.6.0-canary.5"}`, '-v, --version', 'Outputs the Next.js version.');
82
+ }).helpCommand(false).helpOption('-h, --help', 'Displays this message.').version(`Next.js v${"15.6.0-canary.7"}`, '-v, --version', 'Outputs the Next.js version.');
83
83
  program.command('build').description('Creates an optimized production build of your application. The output displays information about each route.').argument('[directory]', `A directory on which to build the application. ${(0, _picocolors.italic)('If no directory is provided, the current directory will be used.')}`).option('-d, --debug', 'Enables a more verbose build output.').option('--debug-prerender', 'Enables debug mode for prerendering. Not for production use!').option('--no-lint', 'Disables linting.').option('--no-mangling', 'Disables mangling.').option('--profile', 'Enables production profiling for React.').option('--experimental-app-only', 'Builds only App Router routes.').option('--turbo', 'Starts development mode using Turbopack.').option('--turbopack', 'Starts development mode using Turbopack.').addOption(new _commander.Option('--experimental-build-mode [mode]', 'Uses an experimental build mode.').choices([
84
84
  'compile',
85
85
  'generate',
@@ -371,7 +371,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
371
371
  const nextBuildSpan = (0, _trace.trace)('next-build', undefined, {
372
372
  buildMode: experimentalBuildMode,
373
373
  isTurboBuild: String(isTurbopack),
374
- version: "15.6.0-canary.5"
374
+ version: "15.6.0-canary.7"
375
375
  });
376
376
  _buildcontext.NextBuildContext.nextBuildSpan = nextBuildSpan;
377
377
  _buildcontext.NextBuildContext.dir = dir;
@@ -850,7 +850,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
850
850
  // Files outside of the distDir can be "type": "module"
851
851
  await writeFileUtf8(_path.default.join(distDir, 'package.json'), '{"type": "commonjs"}');
852
852
  // These are written to distDir, so they need to come after creating and cleaning distDr.
853
- await (0, _builddiagnostics.recordFrameworkVersion)("15.6.0-canary.5");
853
+ await (0, _builddiagnostics.recordFrameworkVersion)("15.6.0-canary.7");
854
854
  await (0, _builddiagnostics.updateBuildDiagnostics)({
855
855
  buildStage: 'start'
856
856
  });
@@ -2509,7 +2509,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
2509
2509
  distDir,
2510
2510
  config,
2511
2511
  staticPages,
2512
- nextVersion: "15.6.0-canary.5",
2512
+ nextVersion: "15.6.0-canary.7",
2513
2513
  tracingRoot: outputFileTracingRoot,
2514
2514
  hasNodeMiddleware,
2515
2515
  hasInstrumentationHook,
@@ -131,7 +131,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
131
131
  }
132
132
  return newObj;
133
133
  }
134
- const nextVersion = "15.6.0-canary.5";
134
+ const nextVersion = "15.6.0-canary.7";
135
135
  const ArchName = (0, _os.arch)();
136
136
  const PlatformName = (0, _os.platform)();
137
137
  function infoLog(...args) {
@@ -339,7 +339,7 @@ async function handler(req, res, ctx) {
339
339
  });
340
340
  span.updateName(name);
341
341
  } else {
342
- span.updateName(`${method} ${req.url}`);
342
+ span.updateName(`${method}`);
343
343
  }
344
344
  });
345
345
  };
@@ -1028,7 +1028,7 @@ async function handler(req, res, ctx) {
1028
1028
  await handleResponse(activeSpan);
1029
1029
  } else {
1030
1030
  return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(_constants.BaseServerSpan.handleRequest, {
1031
- spanName: `${method} ${req.url}`,
1031
+ spanName: `${method}`,
1032
1032
  kind: _tracer.SpanKind.SERVER,
1033
1033
  attributes: {
1034
1034
  'http.method': method,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/build/templates/app-page.ts"],"sourcesContent":["import type { LoaderTree } from '../../server/lib/app-dir-module'\nimport type { IncomingMessage, ServerResponse } from 'node:http'\n\nimport {\n AppPageRouteModule,\n type AppPageRouteHandlerContext,\n} from '../../server/route-modules/app-page/module.compiled' with { 'turbopack-transition': 'next-ssr' }\n\nimport { RouteKind } from '../../server/route-kind' with { 'turbopack-transition': 'next-server-utility' }\n\nimport { getRevalidateReason } from '../../server/instrumentation/utils'\nimport { getTracer, SpanKind, type Span } from '../../server/lib/trace/tracer'\nimport { getRequestMeta } from '../../server/request-meta'\nimport { BaseServerSpan } from '../../server/lib/trace/constants'\nimport { interopDefault } from '../../server/app-render/interop-default'\nimport { stripFlightHeaders } from '../../server/app-render/strip-flight-headers'\nimport { NodeNextRequest, NodeNextResponse } from '../../server/base-http/node'\nimport { checkIsAppPPREnabled } from '../../server/lib/experimental/ppr'\nimport {\n getFallbackRouteParams,\n createOpaqueFallbackRouteParams,\n type OpaqueFallbackRouteParams,\n} from '../../server/request/fallback-params'\nimport { setReferenceManifestsSingleton } from '../../server/app-render/encryption-utils'\nimport {\n isHtmlBotRequest,\n shouldServeStreamingMetadata,\n} from '../../server/lib/streaming-metadata'\nimport { createServerModuleMap } from '../../server/app-render/action-utils'\nimport { normalizeAppPath } from '../../shared/lib/router/utils/app-paths'\nimport { getIsPossibleServerAction } from '../../server/lib/server-action-request-meta'\nimport {\n RSC_HEADER,\n NEXT_ROUTER_PREFETCH_HEADER,\n NEXT_IS_PRERENDER_HEADER,\n NEXT_DID_POSTPONE_HEADER,\n RSC_CONTENT_TYPE_HEADER,\n} from '../../client/components/app-router-headers'\nimport { getBotType, isBot } from '../../shared/lib/router/utils/is-bot'\nimport {\n CachedRouteKind,\n IncrementalCacheKind,\n type CachedAppPageValue,\n type CachedPageValue,\n type ResponseCacheEntry,\n type ResponseGenerator,\n} from '../../server/response-cache'\nimport { FallbackMode, parseFallbackField } from '../../lib/fallback'\nimport RenderResult from '../../server/render-result'\nimport {\n CACHE_ONE_YEAR,\n HTML_CONTENT_TYPE_HEADER,\n NEXT_CACHE_TAGS_HEADER,\n} from '../../lib/constants'\nimport type { CacheControl } from '../../server/lib/cache-control'\nimport { ENCODED_TAGS } from '../../server/stream-utils/encoded-tags'\nimport { sendRenderResult } from '../../server/send-payload'\nimport { NoFallbackError } from '../../shared/lib/no-fallback-error.external'\n\n// These are injected by the loader afterwards.\n\n/**\n * The tree created in next-app-loader that holds component segments and modules\n * and I've updated it.\n */\ndeclare const tree: LoaderTree\n\n// We inject the tree and pages here so that we can use them in the route\n// module.\n// INJECT:tree\n\nimport GlobalError from 'VAR_MODULE_GLOBAL_ERROR' with { 'turbopack-transition': 'next-server-utility' }\n\nexport { GlobalError }\n\n// These are injected by the loader afterwards.\ndeclare const __next_app_require__: (id: string | number) => unknown\ndeclare const __next_app_load_chunk__: (id: string | number) => Promise<unknown>\n\n// INJECT:__next_app_require__\n// INJECT:__next_app_load_chunk__\n\nexport const __next_app__ = {\n require: __next_app_require__,\n loadChunk: __next_app_load_chunk__,\n}\n\nimport * as entryBase from '../../server/app-render/entry-base' with { 'turbopack-transition': 'next-server-utility' }\nimport { RedirectStatusCode } from '../../client/components/redirect-status-code'\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport { scheduleOnNextTick } from '../../lib/scheduler'\nimport { isInterceptionRouteAppPath } from '../../shared/lib/router/utils/interception-routes'\n\nexport * from '../../server/app-render/entry-base' with { 'turbopack-transition': 'next-server-utility' }\n\n// Create and export the route module that will be consumed.\nexport const routeModule = new AppPageRouteModule({\n definition: {\n kind: RouteKind.APP_PAGE,\n page: 'VAR_DEFINITION_PAGE',\n pathname: 'VAR_DEFINITION_PATHNAME',\n // The following aren't used in production.\n bundlePath: '',\n filename: '',\n appPaths: [],\n },\n userland: {\n loaderTree: tree,\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n})\n\nexport async function handler(\n req: IncomingMessage,\n res: ServerResponse,\n ctx: {\n waitUntil: (prom: Promise<void>) => void\n }\n) {\n let srcPage = 'VAR_DEFINITION_PAGE'\n\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/'\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/'\n }\n const multiZoneDraftMode = process.env\n .__NEXT_MULTI_ZONE_DRAFT_MODE as any as boolean\n\n // TODO: replace with more specific flags\n const minimalMode = getRequestMeta(req, 'minimalMode')\n\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode,\n })\n\n if (!prepareResult) {\n res.statusCode = 400\n res.end('Bad Request')\n ctx.waitUntil?.(Promise.resolve())\n return null\n }\n\n const {\n buildId,\n query,\n params,\n pageIsDynamic,\n buildManifest,\n nextFontManifest,\n reactLoadableManifest,\n serverActionsManifest,\n clientReferenceManifest,\n subresourceIntegrityManifest,\n prerenderManifest,\n isDraftMode,\n resolvedPathname,\n revalidateOnlyGenerated,\n routerServerContext,\n nextConfig,\n interceptionRoutePatterns,\n } = prepareResult\n\n const normalizedSrcPage = normalizeAppPath(srcPage)\n\n let { isOnDemandRevalidate } = prepareResult\n\n // We use the resolvedPathname instead of the parsedUrl.pathname because it\n // is not rewritten as resolvedPathname is. This will ensure that the correct\n // prerender info is used instead of using the original pathname as the\n // source. If however PPR is enabled and cacheComponents is disabled, we\n // treat the pathname as dynamic. Currently, there's a bug in the PPR\n // implementation that incorrectly leaves %%drp placeholders in the output of\n // parallel routes. This is addressed with cacheComponents.\n const prerenderInfo =\n nextConfig.experimental.ppr &&\n !nextConfig.experimental.cacheComponents &&\n isInterceptionRouteAppPath(resolvedPathname)\n ? null\n : routeModule.match(resolvedPathname, prerenderManifest)\n\n const isPrerendered = !!prerenderManifest.routes[resolvedPathname]\n\n const userAgent = req.headers['user-agent'] || ''\n const botType = getBotType(userAgent)\n const isHtmlBot = isHtmlBotRequest(req)\n\n /**\n * If true, this indicates that the request being made is for an app\n * prefetch request.\n */\n const isPrefetchRSCRequest =\n getRequestMeta(req, 'isPrefetchRSCRequest') ??\n req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2'\n\n // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later\n\n const isRSCRequest =\n getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER])\n\n const isPossibleServerAction = getIsPossibleServerAction(req)\n\n /**\n * If the route being rendered is an app page, and the ppr feature has been\n * enabled, then the given route _could_ support PPR.\n */\n const couldSupportPPR: boolean = checkIsAppPPREnabled(\n nextConfig.experimental.ppr\n )\n\n // When enabled, this will allow the use of the `?__nextppronly` query to\n // enable debugging of the static shell.\n const hasDebugStaticShellQuery =\n process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' &&\n typeof query.__nextppronly !== 'undefined' &&\n couldSupportPPR\n\n // When enabled, this will allow the use of the `?__nextppronly` query\n // to enable debugging of the fallback shell.\n const hasDebugFallbackShellQuery =\n hasDebugStaticShellQuery && query.__nextppronly === 'fallback'\n\n // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the\n // prerender manifest and this is an app page.\n const isRoutePPREnabled: boolean =\n couldSupportPPR &&\n ((\n prerenderManifest.routes[normalizedSrcPage] ??\n prerenderManifest.dynamicRoutes[normalizedSrcPage]\n )?.renderingMode === 'PARTIALLY_STATIC' ||\n // Ideally we'd want to check the appConfig to see if this page has PPR\n // enabled or not, but that would require plumbing the appConfig through\n // to the server during development. We assume that the page supports it\n // but only during development.\n (hasDebugStaticShellQuery &&\n (routeModule.isDev === true ||\n routerServerContext?.experimentalTestProxy === true)))\n\n const isDebugStaticShell: boolean =\n hasDebugStaticShellQuery && isRoutePPREnabled\n\n // We should enable debugging dynamic accesses when the static shell\n // debugging has been enabled and we're also in development mode.\n const isDebugDynamicAccesses =\n isDebugStaticShell && routeModule.isDev === true\n\n const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled\n\n // If we're in minimal mode, then try to get the postponed information from\n // the request metadata. If available, use it for resuming the postponed\n // render.\n const minimalPostponed = isRoutePPREnabled\n ? getRequestMeta(req, 'postponed')\n : undefined\n\n // If PPR is enabled, and this is a RSC request (but not a prefetch), then\n // we can use this fact to only generate the flight data for the request\n // because we can't cache the HTML (as it's also dynamic).\n const isDynamicRSCRequest =\n isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest\n\n // Need to read this before it's stripped by stripFlightHeaders. We don't\n // need to transfer it to the request meta because it's only read\n // within this function; the static segment data should have already been\n // generated, so we will always either return a static response or a 404.\n const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest')\n\n // TODO: investigate existing bug with shouldServeStreamingMetadata always\n // being true for a revalidate due to modifying the base-server this.renderOpts\n // when fixing this to correct logic it causes hydration issue since we set\n // serveStreamingMetadata to true during export\n const serveStreamingMetadata =\n isHtmlBot && isRoutePPREnabled\n ? false\n : !userAgent\n ? true\n : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots)\n\n const isSSG = Boolean(\n (prerenderInfo ||\n isPrerendered ||\n prerenderManifest.routes[normalizedSrcPage]) &&\n // If this is a html bot request and PPR is enabled, then we don't want\n // to serve a static response.\n !(isHtmlBot && isRoutePPREnabled)\n )\n\n // When a page supports PPR, we can support RSC for Navigations so long as the\n // feature is not disabled.\n const supportsRSCForNavigations =\n isRoutePPREnabled &&\n nextConfig.experimental.rdcForNavigations === true &&\n // Temporarily we require that clientParamParsing is enabled for\n // RDC for Navigations. This is due to a builder configuration\n // bug that manifests as invalid query params being passed to\n // the resume lambdas.\n nextConfig.experimental.clientParamParsing === true\n\n // In development, we always want to generate dynamic HTML.\n const supportsDynamicResponse: boolean =\n // If we're in development, we always support dynamic HTML, unless it's\n // a data request, in which case we only produce static HTML.\n routeModule.isDev === true ||\n // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isSSG ||\n // If this request has provided postponed data, it supports dynamic\n // HTML.\n typeof minimalPostponed === 'string' ||\n // If this handler supports onCacheEntryV2, then we can only support\n // dynamic responses if it's a dynamic RSC request and not in minimal mode. If it\n // doesn't support it we must fallback to the default behavior.\n (supportsRSCForNavigations && getRequestMeta(req, 'onCacheEntryV2')\n ? // In minimal mode, we'll always want to generate a static response\n // which will generate the RDC for the route. When resuming a Dynamic\n // RSC request, we'll pass the minimal postponed data to the render\n // which will trigger the `supportsDynamicResponse` to be true.\n isDynamicRSCRequest && !minimalMode\n : // Otherwise, we can support dynamic responses if it's a dynamic RSC request.\n isDynamicRSCRequest)\n\n // When html bots request PPR page, perform the full dynamic rendering.\n const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled\n\n let ssgCacheKey: string | null = null\n if (\n !isDraftMode &&\n isSSG &&\n !supportsDynamicResponse &&\n !isPossibleServerAction &&\n !minimalPostponed &&\n !isDynamicRSCRequest\n ) {\n ssgCacheKey = resolvedPathname\n }\n\n // the staticPathKey differs from ssgCacheKey since\n // ssgCacheKey is null in dev since we're always in \"dynamic\"\n // mode in dev to bypass the cache, but we still need to honor\n // dynamicParams = false in dev mode\n let staticPathKey = ssgCacheKey\n if (!staticPathKey && routeModule.isDev) {\n staticPathKey = resolvedPathname\n }\n\n // If this is a request for an app path that should be statically generated\n // and we aren't in the edge runtime, strip the flight headers so it will\n // generate the static response.\n if (\n !routeModule.isDev &&\n !isDraftMode &&\n isSSG &&\n isRSCRequest &&\n !isDynamicRSCRequest\n ) {\n stripFlightHeaders(req.headers)\n }\n\n const ComponentMod = {\n ...entryBase,\n tree,\n GlobalError,\n handler,\n routeModule,\n __next_app__,\n }\n\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setReferenceManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest,\n serverModuleMap: createServerModuleMap({\n serverActionsManifest,\n }),\n })\n }\n\n const method = req.method || 'GET'\n const tracer = getTracer()\n const activeSpan = tracer.getActiveScopeSpan()\n\n try {\n const varyHeader = routeModule.getVaryHeader(\n resolvedPathname,\n interceptionRoutePatterns\n )\n res.setHeader('Vary', varyHeader)\n const invokeRouteModule = async (\n span: Span | undefined,\n context: AppPageRouteHandlerContext\n ) => {\n const nextReq = new NodeNextRequest(req)\n const nextRes = new NodeNextResponse(res)\n\n // TODO: adapt for putting the RDC inside the postponed data\n // If we're in dev, and this isn't a prefetch or a server action,\n // we should seed the resume data cache.\n if (process.env.NODE_ENV === 'development') {\n if (\n nextConfig.experimental.cacheComponents &&\n !isPrefetchRSCRequest &&\n !context.renderOpts.isPossibleServerAction\n ) {\n const warmup = await routeModule.warmup(nextReq, nextRes, context)\n\n // If the warmup is successful, we should use the resume data\n // cache from the warmup.\n if (warmup.metadata.renderResumeDataCache) {\n context.renderOpts.renderResumeDataCache =\n warmup.metadata.renderResumeDataCache\n }\n }\n }\n\n return routeModule.render(nextReq, nextRes, context).finally(() => {\n if (!span) return\n\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false,\n })\n\n const rootSpanAttributes = tracer.getRootSpanAttributes()\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return\n }\n\n if (\n rootSpanAttributes.get('next.span_type') !==\n BaseServerSpan.handleRequest\n ) {\n console.warn(\n `Unexpected root span type '${rootSpanAttributes.get(\n 'next.span_type'\n )}'. Please report this Next.js issue https://github.com/vercel/next.js`\n )\n return\n }\n\n const route = rootSpanAttributes.get('next.route')\n if (route) {\n const name = `${method} ${route}`\n\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name,\n })\n span.updateName(name)\n } else {\n span.updateName(`${method} ${req.url}`)\n }\n })\n }\n\n const incrementalCache = getRequestMeta(req, 'incrementalCache')\n\n const doRender = async ({\n span,\n postponed,\n fallbackRouteParams,\n forceStaticRender,\n }: {\n span?: Span\n\n /**\n * The postponed data for this render. This is only provided when resuming\n * a render that has been postponed.\n */\n postponed: string | undefined\n\n /**\n * The unknown route params for this render.\n */\n fallbackRouteParams: OpaqueFallbackRouteParams | null\n\n /**\n * When true, this indicates that the response generator is being called\n * in a context where the response must be generated statically.\n *\n * CRITICAL: This should only currently be used when revalidating due to a\n * dynamic RSC request.\n */\n forceStaticRender: boolean\n }): Promise<ResponseCacheEntry> => {\n const context: AppPageRouteHandlerContext = {\n query,\n params,\n page: normalizedSrcPage,\n sharedContext: {\n buildId,\n },\n serverComponentsHmrCache: getRequestMeta(\n req,\n 'serverComponentsHmrCache'\n ),\n fallbackRouteParams,\n renderOpts: {\n App: () => null,\n Document: () => null,\n pageConfig: {},\n ComponentMod,\n Component: interopDefault(ComponentMod),\n\n params,\n routeModule,\n page: srcPage,\n postponed,\n shouldWaitOnAllReady,\n serveStreamingMetadata,\n supportsDynamicResponse:\n typeof postponed === 'string' || supportsDynamicResponse,\n buildManifest,\n nextFontManifest,\n reactLoadableManifest,\n subresourceIntegrityManifest,\n serverActionsManifest,\n clientReferenceManifest,\n setIsrStatus: routerServerContext?.setIsrStatus,\n setReactDebugChannel: routerServerContext?.setReactDebugChannel,\n\n dir:\n process.env.NEXT_RUNTIME === 'nodejs'\n ? (require('path') as typeof import('path')).join(\n /* turbopackIgnore: true */\n process.cwd(),\n routeModule.relativeProjectDir\n )\n : `${process.cwd()}/${routeModule.relativeProjectDir}`,\n isDraftMode,\n isRevalidate: isSSG && !postponed && !isDynamicRSCRequest,\n botType,\n isOnDemandRevalidate,\n isPossibleServerAction,\n assetPrefix: nextConfig.assetPrefix,\n nextConfigOutput: nextConfig.output,\n crossOrigin: nextConfig.crossOrigin,\n trailingSlash: nextConfig.trailingSlash,\n previewProps: prerenderManifest.preview,\n deploymentId: nextConfig.deploymentId,\n enableTainting: nextConfig.experimental.taint,\n htmlLimitedBots: nextConfig.htmlLimitedBots,\n reactMaxHeadersLength: nextConfig.reactMaxHeadersLength,\n\n multiZoneDraftMode,\n incrementalCache,\n cacheLifeProfiles: nextConfig.experimental.cacheLife,\n basePath: nextConfig.basePath,\n serverActions: nextConfig.experimental.serverActions,\n\n ...(isDebugStaticShell ||\n isDebugDynamicAccesses ||\n isDebugFallbackShell\n ? {\n nextExport: true,\n supportsDynamicResponse: false,\n isStaticGeneration: true,\n isRevalidate: true,\n isDebugDynamicAccesses: isDebugDynamicAccesses,\n }\n : {}),\n\n experimental: {\n isRoutePPREnabled,\n expireTime: nextConfig.expireTime,\n staleTimes: nextConfig.experimental.staleTimes,\n cacheComponents: Boolean(nextConfig.experimental.cacheComponents),\n clientSegmentCache: Boolean(\n nextConfig.experimental.clientSegmentCache\n ),\n clientParamParsing: Boolean(\n nextConfig.experimental.clientParamParsing\n ),\n dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover),\n inlineCss: Boolean(nextConfig.experimental.inlineCss),\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts),\n clientTraceMetadata:\n nextConfig.experimental.clientTraceMetadata || ([] as any),\n clientParamParsingOrigins:\n nextConfig.experimental.clientParamParsingOrigins,\n },\n\n waitUntil: ctx.waitUntil,\n onClose: (cb) => {\n res.on('close', cb)\n },\n onAfterTaskError: () => {},\n\n onInstrumentationRequestError: (error, _request, errorContext) =>\n routeModule.onRequestError(\n req,\n error,\n errorContext,\n routerServerContext\n ),\n err: getRequestMeta(req, 'invokeError'),\n dev: routeModule.isDev,\n },\n }\n\n if (isDebugStaticShell || isDebugDynamicAccesses) {\n context.renderOpts.nextExport = true\n context.renderOpts.supportsDynamicResponse = false\n context.renderOpts.isRevalidate = true\n context.renderOpts.isDebugDynamicAccesses = isDebugDynamicAccesses\n }\n\n // When we're revalidating in the background, we should not allow dynamic\n // responses.\n if (forceStaticRender) {\n context.renderOpts.supportsDynamicResponse = false\n }\n\n const result = await invokeRouteModule(span, context)\n\n const { metadata } = result\n\n const {\n cacheControl,\n headers = {},\n // Add any fetch tags that were on the page to the response headers.\n fetchTags: cacheTags,\n fetchMetrics,\n } = metadata\n\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags\n }\n\n // Pull any fetch metrics from the render onto the request.\n ;(req as any).fetchMetrics = fetchMetrics\n\n // we don't throw static to dynamic errors in dev as isSSG\n // is a best guess in dev since we don't have the prerender pass\n // to know whether the path is actually static or not\n if (\n isSSG &&\n cacheControl?.revalidate === 0 &&\n !routeModule.isDev &&\n !isRoutePPREnabled\n ) {\n const staticBailoutInfo = metadata.staticBailoutInfo\n\n const err = new Error(\n `Page changed from static to dynamic at runtime ${resolvedPathname}${\n staticBailoutInfo?.description\n ? `, reason: ${staticBailoutInfo.description}`\n : ``\n }` +\n `\\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`\n )\n\n if (staticBailoutInfo?.stack) {\n const stack = staticBailoutInfo.stack\n err.stack = err.message + stack.substring(stack.indexOf('\\n'))\n }\n\n throw err\n }\n\n return {\n value: {\n kind: CachedRouteKind.APP_PAGE,\n html: result,\n headers,\n rscData: metadata.flightData,\n postponed: metadata.postponed,\n status: metadata.statusCode,\n segmentData: metadata.segmentData,\n } satisfies CachedAppPageValue,\n cacheControl,\n } satisfies ResponseCacheEntry\n }\n\n const responseGenerator: ResponseGenerator = async ({\n hasResolved,\n previousCacheEntry: previousIncrementalCacheEntry,\n isRevalidating,\n span,\n forceStaticRender = false,\n }) => {\n const isProduction = routeModule.isDev === false\n const didRespond = hasResolved || res.writableEnded\n\n // skip on-demand revalidate if cache is not present and\n // revalidate-if-generated is set\n if (\n isOnDemandRevalidate &&\n revalidateOnlyGenerated &&\n !previousIncrementalCacheEntry &&\n !minimalMode\n ) {\n if (routerServerContext?.render404) {\n await routerServerContext.render404(req, res)\n } else {\n res.statusCode = 404\n res.end('This page could not be found')\n }\n return null\n }\n\n let fallbackMode: FallbackMode | undefined\n\n if (prerenderInfo) {\n fallbackMode = parseFallbackField(prerenderInfo.fallback)\n }\n\n // When serving a HTML bot request, we want to serve a blocking render and\n // not the prerendered page. This ensures that the correct content is served\n // to the bot in the head.\n if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) {\n if (!isRoutePPREnabled || isHtmlBot) {\n fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER\n }\n }\n\n if (previousIncrementalCacheEntry?.isStale === -1) {\n isOnDemandRevalidate = true\n }\n\n // TODO: adapt for PPR\n // only allow on-demand revalidate for fallback: true/blocking\n // or for prerendered fallback: false paths\n if (\n isOnDemandRevalidate &&\n (fallbackMode !== FallbackMode.NOT_FOUND ||\n previousIncrementalCacheEntry)\n ) {\n fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER\n }\n\n if (\n !minimalMode &&\n fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER &&\n staticPathKey &&\n !didRespond &&\n !isDraftMode &&\n pageIsDynamic &&\n (isProduction || !isPrerendered)\n ) {\n // if the page has dynamicParams: false and this pathname wasn't\n // prerendered trigger the no fallback handling\n if (\n // In development, fall through to render to handle missing\n // getStaticPaths.\n (isProduction || prerenderInfo) &&\n // When fallback isn't present, abort this render so we 404\n fallbackMode === FallbackMode.NOT_FOUND\n ) {\n throw new NoFallbackError()\n }\n\n // When client param parsing is enabled, we can use the fallback\n // response if the request is not a dynamic RSC request because the\n // RSC data when this feature flag is enabled does not contain any\n // param references. Without this feature flag enabled, the RSC data\n // contains param references, and therefore we can't use the fallback.\n if (\n isRoutePPREnabled &&\n (nextConfig.experimental.clientParamParsing\n ? !isDynamicRSCRequest\n : !isRSCRequest)\n ) {\n const cacheKey =\n isProduction && typeof prerenderInfo?.fallback === 'string'\n ? prerenderInfo.fallback\n : normalizedSrcPage\n\n const fallbackRouteParams =\n // If we're in production and we have fallback route params, then we\n // can use the manifest fallback route params.\n isProduction && prerenderInfo?.fallbackRouteParams\n ? createOpaqueFallbackRouteParams(\n prerenderInfo.fallbackRouteParams\n )\n : // Otherwise, if we're debugging the fallback shell, then we\n // have to manually generate the fallback route params.\n isDebugFallbackShell\n ? getFallbackRouteParams(normalizedSrcPage, routeModule)\n : null\n\n // We use the response cache here to handle the revalidation and\n // management of the fallback shell.\n const fallbackResponse = await routeModule.handleResponse({\n cacheKey,\n req,\n nextConfig,\n routeKind: RouteKind.APP_PAGE,\n isFallback: true,\n prerenderManifest,\n isRoutePPREnabled,\n responseGenerator: async () =>\n doRender({\n span,\n // We pass `undefined` as rendering a fallback isn't resumed\n // here.\n postponed: undefined,\n fallbackRouteParams,\n forceStaticRender: false,\n }),\n waitUntil: ctx.waitUntil,\n })\n\n // If the fallback response was set to null, then we should return null.\n if (fallbackResponse === null) return null\n\n // Otherwise, if we did get a fallback response, we should return it.\n if (fallbackResponse) {\n // Remove the cache control from the response to prevent it from being\n // used in the surrounding cache.\n delete fallbackResponse.cacheControl\n\n return fallbackResponse\n }\n }\n }\n\n // Only requests that aren't revalidating can be resumed. If we have the\n // minimal postponed data, then we should resume the render with it.\n let postponed =\n !isOnDemandRevalidate && !isRevalidating && minimalPostponed\n ? minimalPostponed\n : undefined\n\n // If this is a dynamic RSC request, we should use the postponed data from\n // the static render (if available). This ensures that we can utilize the\n // resume data cache (RDC) from the static render to ensure that the data\n // is consistent between the static and dynamic renders.\n if (\n // Only enable RDC for Navigations if the feature is enabled.\n supportsRSCForNavigations &&\n process.env.NEXT_RUNTIME !== 'edge' &&\n !minimalMode &&\n incrementalCache &&\n isDynamicRSCRequest &&\n // We don't typically trigger an on-demand revalidation for dynamic RSC\n // requests, as we're typically revalidating the page in the background\n // instead. However, if the cache entry is stale, we should trigger a\n // background revalidation on dynamic RSC requests. This prevents us\n // from entering an infinite loop of revalidations.\n !forceStaticRender\n ) {\n const incrementalCacheEntry = await incrementalCache.get(\n resolvedPathname,\n {\n kind: IncrementalCacheKind.APP_PAGE,\n isRoutePPREnabled: true,\n isFallback: false,\n // CRITICAL: we need to allow stale here as we'll revalidate in the\n // background if it's stale. We _want_ to possibly serve a stale\n // response here as it'll be consistent with the static render.\n allowStale: true,\n }\n )\n\n // If the cache entry is found, we should use the postponed data from\n // the cache.\n if (\n incrementalCacheEntry &&\n incrementalCacheEntry.value &&\n incrementalCacheEntry.value.kind === CachedRouteKind.APP_PAGE\n ) {\n // CRITICAL: we're assigning the postponed data from the cache entry\n // here as we're using the RDC to resume the render.\n postponed = incrementalCacheEntry.value.postponed\n\n // If the cache entry is stale, we should trigger a background\n // revalidation so that subsequent requests will get a fresh response.\n if (\n incrementalCacheEntry &&\n // We want to trigger this flow if the cache entry is stale and if\n // the requested revalidation flow is either foreground or\n // background.\n (incrementalCacheEntry.isStale === -1 ||\n incrementalCacheEntry.isStale === true)\n ) {\n // We want to schedule this on the next tick to ensure that the\n // render is not blocked on it.\n scheduleOnNextTick(async () => {\n const responseCache = routeModule.getResponseCache(req)\n\n try {\n await responseCache.revalidate(\n resolvedPathname,\n incrementalCache,\n isRoutePPREnabled,\n false,\n (c) =>\n responseGenerator({\n ...c,\n // CRITICAL: we need to set this to true as we're\n // revalidating in the background and typically this dynamic\n // RSC request is not treated as static.\n forceStaticRender: true,\n }),\n // CRITICAL: we need to pass null here because passing the\n // previous cache entry here (which is stale) will switch on\n // isOnDemandRevalidate and break the prerendering.\n null,\n hasResolved,\n ctx.waitUntil\n )\n } catch (err) {\n console.error(\n 'Error revalidating the page in the background',\n err\n )\n }\n })\n }\n }\n }\n\n // When we're in minimal mode, if we're trying to debug the static shell,\n // we should just return nothing instead of resuming the dynamic render.\n if (\n (isDebugStaticShell || isDebugDynamicAccesses) &&\n typeof postponed !== 'undefined'\n ) {\n return {\n cacheControl: { revalidate: 1, expire: undefined },\n value: {\n kind: CachedRouteKind.PAGES,\n html: RenderResult.EMPTY,\n pageData: {},\n headers: undefined,\n status: undefined,\n } satisfies CachedPageValue,\n }\n }\n\n const fallbackRouteParams =\n // If we're in production and we have fallback route params, then we\n // can use the manifest fallback route params if we need to render the\n // fallback shell.\n isProduction &&\n prerenderInfo?.fallbackRouteParams &&\n getRequestMeta(req, 'renderFallbackShell')\n ? createOpaqueFallbackRouteParams(prerenderInfo.fallbackRouteParams)\n : // Otherwise, if we're debugging the fallback shell, then we have to\n // manually generate the fallback route params.\n isDebugFallbackShell\n ? getFallbackRouteParams(normalizedSrcPage, routeModule)\n : null\n\n // Perform the render.\n return doRender({\n span,\n postponed,\n fallbackRouteParams,\n forceStaticRender,\n })\n }\n\n const handleResponse = async (span?: Span): Promise<null | void> => {\n const cacheEntry = await routeModule.handleResponse({\n cacheKey: ssgCacheKey,\n responseGenerator: (c) =>\n responseGenerator({\n span,\n ...c,\n }),\n routeKind: RouteKind.APP_PAGE,\n isOnDemandRevalidate,\n isRoutePPREnabled,\n req,\n nextConfig,\n prerenderManifest,\n waitUntil: ctx.waitUntil,\n })\n\n if (isDraftMode) {\n res.setHeader(\n 'Cache-Control',\n 'private, no-cache, no-store, max-age=0, must-revalidate'\n )\n }\n\n // In dev, we should not cache pages for any reason.\n if (routeModule.isDev) {\n res.setHeader('Cache-Control', 'no-store, must-revalidate')\n }\n\n if (!cacheEntry) {\n if (ssgCacheKey) {\n // A cache entry might not be generated if a response is written\n // in `getInitialProps` or `getServerSideProps`, but those shouldn't\n // have a cache key. If we do have a cache key but we don't end up\n // with a cache entry, then either Next.js or the application has a\n // bug that needs fixing.\n throw new Error('invariant: cache entry required but not generated')\n }\n return null\n }\n\n if (cacheEntry.value?.kind !== CachedRouteKind.APP_PAGE) {\n throw new Error(\n `Invariant app-page handler received invalid cache entry ${cacheEntry.value?.kind}`\n )\n }\n\n const didPostpone = typeof cacheEntry.value.postponed === 'string'\n\n if (\n isSSG &&\n // We don't want to send a cache header for requests that contain dynamic\n // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC\n // request, then we should set the cache header.\n !isDynamicRSCRequest &&\n (!didPostpone || isPrefetchRSCRequest)\n ) {\n if (!minimalMode) {\n // set x-nextjs-cache header to match the header\n // we set for the image-optimizer\n res.setHeader(\n 'x-nextjs-cache',\n isOnDemandRevalidate\n ? 'REVALIDATED'\n : cacheEntry.isMiss\n ? 'MISS'\n : cacheEntry.isStale\n ? 'STALE'\n : 'HIT'\n )\n }\n // Set a header used by the client router to signal the response is static\n // and should respect the `static` cache staleTime value.\n res.setHeader(NEXT_IS_PRERENDER_HEADER, '1')\n }\n const { value: cachedData } = cacheEntry\n\n // Coerce the cache control parameter from the render.\n let cacheControl: CacheControl | undefined\n\n // If this is a resume request in minimal mode it is streamed with dynamic\n // content and should not be cached.\n if (minimalPostponed) {\n cacheControl = { revalidate: 0, expire: undefined }\n }\n\n // If this is in minimal mode and this is a flight request that isn't a\n // prefetch request while PPR is enabled, it cannot be cached as it contains\n // dynamic content.\n else if (isDynamicRSCRequest) {\n cacheControl = { revalidate: 0, expire: undefined }\n } else if (!routeModule.isDev) {\n // If this is a preview mode request, we shouldn't cache it\n if (isDraftMode) {\n cacheControl = { revalidate: 0, expire: undefined }\n }\n\n // If this isn't SSG, then we should set change the header only if it is\n // not set already.\n else if (!isSSG) {\n if (!res.getHeader('Cache-Control')) {\n cacheControl = { revalidate: 0, expire: undefined }\n }\n } else if (cacheEntry.cacheControl) {\n // If the cache entry has a cache control with a revalidate value that's\n // a number, use it.\n if (typeof cacheEntry.cacheControl.revalidate === 'number') {\n if (cacheEntry.cacheControl.revalidate < 1) {\n throw new Error(\n `Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`\n )\n }\n\n cacheControl = {\n revalidate: cacheEntry.cacheControl.revalidate,\n expire: cacheEntry.cacheControl?.expire ?? nextConfig.expireTime,\n }\n }\n // Otherwise if the revalidate value is false, then we should use the\n // cache time of one year.\n else {\n cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }\n }\n }\n }\n\n cacheEntry.cacheControl = cacheControl\n\n if (\n typeof segmentPrefetchHeader === 'string' &&\n cachedData?.kind === CachedRouteKind.APP_PAGE &&\n cachedData.segmentData\n ) {\n // This is a prefetch request issued by the client Segment Cache. These\n // should never reach the application layer (lambda). We should either\n // respond from the cache (HIT) or respond with 204 No Content (MISS).\n\n // Set a header to indicate that PPR is enabled for this route. This\n // lets the client distinguish between a regular cache miss and a cache\n // miss due to PPR being disabled. In other contexts this header is used\n // to indicate that the response contains dynamic data, but here we're\n // only using it to indicate that the feature is enabled — the segment\n // response itself contains whether the data is dynamic.\n res.setHeader(NEXT_DID_POSTPONE_HEADER, '2')\n\n // Add the cache tags header to the response if it exists and we're in\n // minimal mode while rendering a static page.\n const tags = cachedData.headers?.[NEXT_CACHE_TAGS_HEADER]\n if (minimalMode && isSSG && tags && typeof tags === 'string') {\n res.setHeader(NEXT_CACHE_TAGS_HEADER, tags)\n }\n\n const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader)\n if (matchedSegment !== undefined) {\n // Cache hit\n return sendRenderResult({\n req,\n res,\n generateEtags: nextConfig.generateEtags,\n poweredByHeader: nextConfig.poweredByHeader,\n result: RenderResult.fromStatic(\n matchedSegment,\n RSC_CONTENT_TYPE_HEADER\n ),\n cacheControl: cacheEntry.cacheControl,\n })\n }\n\n // Cache miss. Either a cache entry for this route has not been generated\n // (which technically should not be possible when PPR is enabled, because\n // at a minimum there should always be a fallback entry) or there's no\n // match for the requested segment. Respond with a 204 No Content. We\n // don't bother to respond with 404, because these requests are only\n // issued as part of a prefetch.\n res.statusCode = 204\n return sendRenderResult({\n req,\n res,\n generateEtags: nextConfig.generateEtags,\n poweredByHeader: nextConfig.poweredByHeader,\n result: RenderResult.EMPTY,\n cacheControl: cacheEntry.cacheControl,\n })\n }\n\n // If there's a callback for `onCacheEntry`, call it with the cache entry\n // and the revalidate options. If we support RDC for Navigations, we\n // prefer the `onCacheEntryV2` callback. Once RDC for Navigations is the\n // default, we can remove the fallback to `onCacheEntry` as\n // `onCacheEntryV2` is now fully supported.\n const onCacheEntry = supportsRSCForNavigations\n ? (getRequestMeta(req, 'onCacheEntryV2') ??\n getRequestMeta(req, 'onCacheEntry'))\n : getRequestMeta(req, 'onCacheEntry')\n if (onCacheEntry) {\n const finished = await onCacheEntry(cacheEntry, {\n url: getRequestMeta(req, 'initURL') ?? req.url,\n })\n if (finished) return null\n }\n\n if (cachedData.headers) {\n const headers = { ...cachedData.headers }\n\n if (!minimalMode || !isSSG) {\n delete headers[NEXT_CACHE_TAGS_HEADER]\n }\n\n for (let [key, value] of Object.entries(headers)) {\n if (typeof value === 'undefined') continue\n\n if (Array.isArray(value)) {\n for (const v of value) {\n res.appendHeader(key, v)\n }\n } else if (typeof value === 'number') {\n value = value.toString()\n res.appendHeader(key, value)\n } else {\n res.appendHeader(key, value)\n }\n }\n }\n\n // Add the cache tags header to the response if it exists and we're in\n // minimal mode while rendering a static page.\n const tags = cachedData.headers?.[NEXT_CACHE_TAGS_HEADER]\n if (minimalMode && isSSG && tags && typeof tags === 'string') {\n res.setHeader(NEXT_CACHE_TAGS_HEADER, tags)\n }\n\n // If the request is a data request, then we shouldn't set the status code\n // from the response because it should always be 200. This should be gated\n // behind the experimental PPR flag.\n if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) {\n res.statusCode = cachedData.status\n }\n\n // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes\n if (\n !minimalMode &&\n cachedData.status &&\n RedirectStatusCode[cachedData.status] &&\n isRSCRequest\n ) {\n res.statusCode = 200\n }\n\n // Mark that the request did postpone.\n if (didPostpone && !isDynamicRSCRequest) {\n res.setHeader(NEXT_DID_POSTPONE_HEADER, '1')\n }\n\n // we don't go through this block when preview mode is true\n // as preview mode is a dynamic request (bypasses cache) and doesn't\n // generate both HTML and payloads in the same request so continue to just\n // return the generated payload\n if (isRSCRequest && !isDraftMode) {\n // If this is a dynamic RSC request, then stream the response.\n if (typeof cachedData.rscData === 'undefined') {\n // If the response is not an RSC response, then we can't serve it.\n if (cachedData.html.contentType !== RSC_CONTENT_TYPE_HEADER) {\n if (nextConfig.experimental.clientParamParsing) {\n // If client param parsing is enabled, then we can return a 404.\n // This was likely an old prefetch request.\n res.statusCode = 404\n return sendRenderResult({\n req,\n res,\n generateEtags: nextConfig.generateEtags,\n poweredByHeader: nextConfig.poweredByHeader,\n result: RenderResult.EMPTY,\n cacheControl: cacheEntry.cacheControl,\n })\n } else {\n // Otherwise this case is not expected.\n throw new InvariantError(\n `Expected RSC response, got ${cachedData.html.contentType}`\n )\n }\n }\n\n return sendRenderResult({\n req,\n res,\n generateEtags: nextConfig.generateEtags,\n poweredByHeader: nextConfig.poweredByHeader,\n result: cachedData.html,\n cacheControl: cacheEntry.cacheControl,\n })\n }\n\n // As this isn't a prefetch request, we should serve the static flight\n // data.\n return sendRenderResult({\n req,\n res,\n generateEtags: nextConfig.generateEtags,\n poweredByHeader: nextConfig.poweredByHeader,\n result: RenderResult.fromStatic(\n cachedData.rscData,\n RSC_CONTENT_TYPE_HEADER\n ),\n cacheControl: cacheEntry.cacheControl,\n })\n }\n\n // This is a request for HTML data.\n const body = cachedData.html\n\n // If there's no postponed state, we should just serve the HTML. This\n // should also be the case for a resume request because it's completed\n // as a server render (rather than a static render).\n if (!didPostpone || minimalMode || isRSCRequest) {\n // If we're in test mode, we should add a sentinel chunk to the response\n // that's between the static and dynamic parts so we can compare the\n // chunks and add assertions.\n if (\n process.env.__NEXT_TEST_MODE &&\n minimalMode &&\n isRoutePPREnabled &&\n body.contentType === HTML_CONTENT_TYPE_HEADER\n ) {\n // As we're in minimal mode, the static part would have already been\n // streamed first. The only part that this streams is the dynamic part\n // so we should FIRST stream the sentinel and THEN the dynamic part.\n body.unshift(createPPRBoundarySentinel())\n }\n\n return sendRenderResult({\n req,\n res,\n generateEtags: nextConfig.generateEtags,\n poweredByHeader: nextConfig.poweredByHeader,\n result: body,\n cacheControl: cacheEntry.cacheControl,\n })\n }\n\n // If we're debugging the static shell or the dynamic API accesses, we\n // should just serve the HTML without resuming the render. The returned\n // HTML will be the static shell so all the Dynamic API's will be used\n // during static generation.\n if (isDebugStaticShell || isDebugDynamicAccesses) {\n // Since we're not resuming the render, we need to at least add the\n // closing body and html tags to create valid HTML.\n body.push(\n new ReadableStream({\n start(controller) {\n controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML)\n controller.close()\n },\n })\n )\n\n return sendRenderResult({\n req,\n res,\n generateEtags: nextConfig.generateEtags,\n poweredByHeader: nextConfig.poweredByHeader,\n result: body,\n cacheControl: { revalidate: 0, expire: undefined },\n })\n }\n\n // If we're in test mode, we should add a sentinel chunk to the response\n // that's between the static and dynamic parts so we can compare the\n // chunks and add assertions.\n if (process.env.__NEXT_TEST_MODE) {\n body.push(createPPRBoundarySentinel())\n }\n\n // This request has postponed, so let's create a new transformer that the\n // dynamic data can pipe to that will attach the dynamic data to the end\n // of the response.\n const transformer = new TransformStream<Uint8Array, Uint8Array>()\n body.push(transformer.readable)\n\n // Perform the render again, but this time, provide the postponed state.\n // We don't await because we want the result to start streaming now, and\n // we've already chained the transformer's readable to the render result.\n doRender({\n span,\n postponed: cachedData.postponed,\n // This is a resume render, not a fallback render, so we don't need to\n // set this.\n fallbackRouteParams: null,\n forceStaticRender: false,\n })\n .then(async (result) => {\n if (!result) {\n throw new Error('Invariant: expected a result to be returned')\n }\n\n if (result.value?.kind !== CachedRouteKind.APP_PAGE) {\n throw new Error(\n `Invariant: expected a page response, got ${result.value?.kind}`\n )\n }\n\n // Pipe the resume result to the transformer.\n await result.value.html.pipeTo(transformer.writable)\n })\n .catch((err) => {\n // An error occurred during piping or preparing the render, abort\n // the transformers writer so we can terminate the stream.\n transformer.writable.abort(err).catch((e) => {\n console.error(\"couldn't abort transformer\", e)\n })\n })\n\n return sendRenderResult({\n req,\n res,\n generateEtags: nextConfig.generateEtags,\n poweredByHeader: nextConfig.poweredByHeader,\n result: body,\n // We don't want to cache the response if it has postponed data because\n // the response being sent to the client it's dynamic parts are streamed\n // to the client on the same request.\n cacheControl: { revalidate: 0, expire: undefined },\n })\n }\n\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (activeSpan) {\n await handleResponse(activeSpan)\n } else {\n return await tracer.withPropagatedContext(req.headers, () =>\n tracer.trace(\n BaseServerSpan.handleRequest,\n {\n spanName: `${method} ${req.url}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url,\n },\n },\n handleResponse\n )\n )\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n await routeModule.onRequestError(\n req,\n err,\n {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'render',\n revalidateReason: getRevalidateReason({\n isRevalidate: isSSG,\n isOnDemandRevalidate,\n }),\n },\n routerServerContext\n )\n }\n\n // rethrow so that we can handle serving error page\n throw err\n }\n}\n\n// TODO: omit this from production builds, only test builds should include it\n/**\n * Creates a readable stream that emits a PPR boundary sentinel.\n *\n * @returns A readable stream that emits a PPR boundary sentinel.\n */\nfunction createPPRBoundarySentinel() {\n return new ReadableStream({\n start(controller) {\n controller.enqueue(\n new TextEncoder().encode('<!-- PPR_BOUNDARY_SENTINEL -->')\n )\n controller.close()\n },\n })\n}\n"],"names":["GlobalError","__next_app__","handler","routeModule","require","__next_app_require__","loadChunk","__next_app_load_chunk__","AppPageRouteModule","definition","kind","RouteKind","APP_PAGE","page","pathname","bundlePath","filename","appPaths","userland","loaderTree","tree","distDir","process","env","__NEXT_RELATIVE_DIST_DIR","relativeProjectDir","__NEXT_RELATIVE_PROJECT_DIR","req","res","ctx","prerenderManifest","srcPage","TURBOPACK","replace","multiZoneDraftMode","__NEXT_MULTI_ZONE_DRAFT_MODE","minimalMode","getRequestMeta","prepareResult","prepare","statusCode","end","waitUntil","Promise","resolve","buildId","query","params","pageIsDynamic","buildManifest","nextFontManifest","reactLoadableManifest","serverActionsManifest","clientReferenceManifest","subresourceIntegrityManifest","isDraftMode","resolvedPathname","revalidateOnlyGenerated","routerServerContext","nextConfig","interceptionRoutePatterns","normalizedSrcPage","normalizeAppPath","isOnDemandRevalidate","prerenderInfo","experimental","ppr","cacheComponents","isInterceptionRouteAppPath","match","isPrerendered","routes","userAgent","headers","botType","getBotType","isHtmlBot","isHtmlBotRequest","isPrefetchRSCRequest","NEXT_ROUTER_PREFETCH_HEADER","isRSCRequest","Boolean","RSC_HEADER","isPossibleServerAction","getIsPossibleServerAction","couldSupportPPR","checkIsAppPPREnabled","hasDebugStaticShellQuery","__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING","__nextppronly","hasDebugFallbackShellQuery","isRoutePPREnabled","dynamicRoutes","renderingMode","isDev","experimentalTestProxy","isDebugStaticShell","isDebugDynamicAccesses","isDebugFallbackShell","minimalPostponed","undefined","isDynamicRSCRequest","segmentPrefetchHeader","serveStreamingMetadata","shouldServeStreamingMetadata","htmlLimitedBots","isSSG","supportsRSCForNavigations","rdcForNavigations","clientParamParsing","supportsDynamicResponse","shouldWaitOnAllReady","ssgCacheKey","staticPathKey","stripFlightHeaders","ComponentMod","entryBase","setReferenceManifestsSingleton","serverModuleMap","createServerModuleMap","method","tracer","getTracer","activeSpan","getActiveScopeSpan","varyHeader","getVaryHeader","setHeader","invokeRouteModule","span","context","nextReq","NodeNextRequest","nextRes","NodeNextResponse","NODE_ENV","renderOpts","warmup","metadata","renderResumeDataCache","render","finally","setAttributes","rootSpanAttributes","getRootSpanAttributes","get","BaseServerSpan","handleRequest","console","warn","route","name","updateName","url","incrementalCache","doRender","postponed","fallbackRouteParams","forceStaticRender","sharedContext","serverComponentsHmrCache","App","Document","pageConfig","Component","interopDefault","setIsrStatus","setReactDebugChannel","dir","NEXT_RUNTIME","join","cwd","isRevalidate","assetPrefix","nextConfigOutput","output","crossOrigin","trailingSlash","previewProps","preview","deploymentId","enableTainting","taint","reactMaxHeadersLength","cacheLifeProfiles","cacheLife","basePath","serverActions","nextExport","isStaticGeneration","expireTime","staleTimes","clientSegmentCache","dynamicOnHover","inlineCss","authInterrupts","clientTraceMetadata","clientParamParsingOrigins","onClose","cb","on","onAfterTaskError","onInstrumentationRequestError","error","_request","errorContext","onRequestError","err","dev","result","cacheControl","fetchTags","cacheTags","fetchMetrics","NEXT_CACHE_TAGS_HEADER","revalidate","staticBailoutInfo","Error","description","stack","message","substring","indexOf","value","CachedRouteKind","html","rscData","flightData","status","segmentData","responseGenerator","hasResolved","previousCacheEntry","previousIncrementalCacheEntry","isRevalidating","isProduction","didRespond","writableEnded","render404","fallbackMode","parseFallbackField","fallback","FallbackMode","PRERENDER","isBot","BLOCKING_STATIC_RENDER","isStale","NOT_FOUND","NoFallbackError","cacheKey","createOpaqueFallbackRouteParams","getFallbackRouteParams","fallbackResponse","handleResponse","routeKind","isFallback","incrementalCacheEntry","IncrementalCacheKind","allowStale","scheduleOnNextTick","responseCache","getResponseCache","c","expire","PAGES","RenderResult","EMPTY","pageData","cacheEntry","cachedData","didPostpone","isMiss","NEXT_IS_PRERENDER_HEADER","getHeader","CACHE_ONE_YEAR","NEXT_DID_POSTPONE_HEADER","tags","matchedSegment","sendRenderResult","generateEtags","poweredByHeader","fromStatic","RSC_CONTENT_TYPE_HEADER","onCacheEntry","finished","key","Object","entries","Array","isArray","v","appendHeader","toString","RedirectStatusCode","contentType","InvariantError","body","__NEXT_TEST_MODE","HTML_CONTENT_TYPE_HEADER","unshift","createPPRBoundarySentinel","push","ReadableStream","start","controller","enqueue","ENCODED_TAGS","CLOSED","BODY_AND_HTML","close","transformer","TransformStream","readable","then","pipeTo","writable","catch","abort","e","withPropagatedContext","trace","spanName","SpanKind","SERVER","attributes","routerKind","routePath","routeType","revalidateReason","getRevalidateReason","TextEncoder","encode"],"mappings":";;;;;;;;;;;;;;;;;IAyESA,WAAW;eAAXA,gCAAW;;IASPC,YAAY;eAAZA;;IA+BSC,OAAO;eAAPA;;IAjBTC,WAAW;eAAXA;;;;gCA1FN;2BAEmB;uBAEU;wBACW;6BAChB;2BACA;gCACA;oCACI;sBACe;qBACb;gCAK9B;iCACwC;mCAIxC;6BAC+B;0BACL;yCACS;kCAOnC;uBAC2B;+BAQ3B;0BAC0C;qEACxB;4BAKlB;6BAEsB;6BACI;yCACD;gFAcR;gFAgBG;oCACQ;gCACJ;2BACI;oCACQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AATpC,MAAMF,eAAe;IAC1BG,SAASC;IACTC,WAAWC;AACb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EAA6E;AAC7E;;;;CAIC,GACD,SAAS6F;IACP,OAAO,IAAIE,eAAe;QACxBC,OAAMC,UAAU;YACdA,WAAWC,OAAO,CAChB,IAAIyB,cAAcC,MAAM,CAAC;YAE3B3B,WAAWK,KAAK;QAClB;IACF;AACF","ignoreList":[0]}
1
+ {"version":3,"sources":["../../../src/build/templates/app-page.ts"],"sourcesContent":["import type { LoaderTree } from '../../server/lib/app-dir-module'\nimport type { IncomingMessage, ServerResponse } from 'node:http'\n\nimport {\n AppPageRouteModule,\n type AppPageRouteHandlerContext,\n} from '../../server/route-modules/app-page/module.compiled' with { 'turbopack-transition': 'next-ssr' }\n\nimport { RouteKind } from '../../server/route-kind' with { 'turbopack-transition': 'next-server-utility' }\n\nimport { getRevalidateReason } from '../../server/instrumentation/utils'\nimport { getTracer, SpanKind, type Span } from '../../server/lib/trace/tracer'\nimport { getRequestMeta } from '../../server/request-meta'\nimport { BaseServerSpan } from '../../server/lib/trace/constants'\nimport { interopDefault } from '../../server/app-render/interop-default'\nimport { stripFlightHeaders } from '../../server/app-render/strip-flight-headers'\nimport { NodeNextRequest, NodeNextResponse } from '../../server/base-http/node'\nimport { checkIsAppPPREnabled } from '../../server/lib/experimental/ppr'\nimport {\n getFallbackRouteParams,\n createOpaqueFallbackRouteParams,\n type OpaqueFallbackRouteParams,\n} from '../../server/request/fallback-params'\nimport { setReferenceManifestsSingleton } from '../../server/app-render/encryption-utils'\nimport {\n isHtmlBotRequest,\n shouldServeStreamingMetadata,\n} from '../../server/lib/streaming-metadata'\nimport { createServerModuleMap } from '../../server/app-render/action-utils'\nimport { normalizeAppPath } from '../../shared/lib/router/utils/app-paths'\nimport { getIsPossibleServerAction } from '../../server/lib/server-action-request-meta'\nimport {\n RSC_HEADER,\n NEXT_ROUTER_PREFETCH_HEADER,\n NEXT_IS_PRERENDER_HEADER,\n NEXT_DID_POSTPONE_HEADER,\n RSC_CONTENT_TYPE_HEADER,\n} from '../../client/components/app-router-headers'\nimport { getBotType, isBot } from '../../shared/lib/router/utils/is-bot'\nimport {\n CachedRouteKind,\n IncrementalCacheKind,\n type CachedAppPageValue,\n type CachedPageValue,\n type ResponseCacheEntry,\n type ResponseGenerator,\n} from '../../server/response-cache'\nimport { FallbackMode, parseFallbackField } from '../../lib/fallback'\nimport RenderResult from '../../server/render-result'\nimport {\n CACHE_ONE_YEAR,\n HTML_CONTENT_TYPE_HEADER,\n NEXT_CACHE_TAGS_HEADER,\n} from '../../lib/constants'\nimport type { CacheControl } from '../../server/lib/cache-control'\nimport { ENCODED_TAGS } from '../../server/stream-utils/encoded-tags'\nimport { sendRenderResult } from '../../server/send-payload'\nimport { NoFallbackError } from '../../shared/lib/no-fallback-error.external'\n\n// These are injected by the loader afterwards.\n\n/**\n * The tree created in next-app-loader that holds component segments and modules\n * and I've updated it.\n */\ndeclare const tree: LoaderTree\n\n// We inject the tree and pages here so that we can use them in the route\n// module.\n// INJECT:tree\n\nimport GlobalError from 'VAR_MODULE_GLOBAL_ERROR' with { 'turbopack-transition': 'next-server-utility' }\n\nexport { GlobalError }\n\n// These are injected by the loader afterwards.\ndeclare const __next_app_require__: (id: string | number) => unknown\ndeclare const __next_app_load_chunk__: (id: string | number) => Promise<unknown>\n\n// INJECT:__next_app_require__\n// INJECT:__next_app_load_chunk__\n\nexport const __next_app__ = {\n require: __next_app_require__,\n loadChunk: __next_app_load_chunk__,\n}\n\nimport * as entryBase from '../../server/app-render/entry-base' with { 'turbopack-transition': 'next-server-utility' }\nimport { RedirectStatusCode } from '../../client/components/redirect-status-code'\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport { scheduleOnNextTick } from '../../lib/scheduler'\nimport { isInterceptionRouteAppPath } from '../../shared/lib/router/utils/interception-routes'\n\nexport * from '../../server/app-render/entry-base' with { 'turbopack-transition': 'next-server-utility' }\n\n// Create and export the route module that will be consumed.\nexport const routeModule = new AppPageRouteModule({\n definition: {\n kind: RouteKind.APP_PAGE,\n page: 'VAR_DEFINITION_PAGE',\n pathname: 'VAR_DEFINITION_PATHNAME',\n // The following aren't used in production.\n bundlePath: '',\n filename: '',\n appPaths: [],\n },\n userland: {\n loaderTree: tree,\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n})\n\nexport async function handler(\n req: IncomingMessage,\n res: ServerResponse,\n ctx: {\n waitUntil: (prom: Promise<void>) => void\n }\n) {\n let srcPage = 'VAR_DEFINITION_PAGE'\n\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/'\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/'\n }\n const multiZoneDraftMode = process.env\n .__NEXT_MULTI_ZONE_DRAFT_MODE as any as boolean\n\n // TODO: replace with more specific flags\n const minimalMode = getRequestMeta(req, 'minimalMode')\n\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode,\n })\n\n if (!prepareResult) {\n res.statusCode = 400\n res.end('Bad Request')\n ctx.waitUntil?.(Promise.resolve())\n return null\n }\n\n const {\n buildId,\n query,\n params,\n pageIsDynamic,\n buildManifest,\n nextFontManifest,\n reactLoadableManifest,\n serverActionsManifest,\n clientReferenceManifest,\n subresourceIntegrityManifest,\n prerenderManifest,\n isDraftMode,\n resolvedPathname,\n revalidateOnlyGenerated,\n routerServerContext,\n nextConfig,\n interceptionRoutePatterns,\n } = prepareResult\n\n const normalizedSrcPage = normalizeAppPath(srcPage)\n\n let { isOnDemandRevalidate } = prepareResult\n\n // We use the resolvedPathname instead of the parsedUrl.pathname because it\n // is not rewritten as resolvedPathname is. This will ensure that the correct\n // prerender info is used instead of using the original pathname as the\n // source. If however PPR is enabled and cacheComponents is disabled, we\n // treat the pathname as dynamic. Currently, there's a bug in the PPR\n // implementation that incorrectly leaves %%drp placeholders in the output of\n // parallel routes. This is addressed with cacheComponents.\n const prerenderInfo =\n nextConfig.experimental.ppr &&\n !nextConfig.experimental.cacheComponents &&\n isInterceptionRouteAppPath(resolvedPathname)\n ? null\n : routeModule.match(resolvedPathname, prerenderManifest)\n\n const isPrerendered = !!prerenderManifest.routes[resolvedPathname]\n\n const userAgent = req.headers['user-agent'] || ''\n const botType = getBotType(userAgent)\n const isHtmlBot = isHtmlBotRequest(req)\n\n /**\n * If true, this indicates that the request being made is for an app\n * prefetch request.\n */\n const isPrefetchRSCRequest =\n getRequestMeta(req, 'isPrefetchRSCRequest') ??\n req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2'\n\n // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later\n\n const isRSCRequest =\n getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER])\n\n const isPossibleServerAction = getIsPossibleServerAction(req)\n\n /**\n * If the route being rendered is an app page, and the ppr feature has been\n * enabled, then the given route _could_ support PPR.\n */\n const couldSupportPPR: boolean = checkIsAppPPREnabled(\n nextConfig.experimental.ppr\n )\n\n // When enabled, this will allow the use of the `?__nextppronly` query to\n // enable debugging of the static shell.\n const hasDebugStaticShellQuery =\n process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' &&\n typeof query.__nextppronly !== 'undefined' &&\n couldSupportPPR\n\n // When enabled, this will allow the use of the `?__nextppronly` query\n // to enable debugging of the fallback shell.\n const hasDebugFallbackShellQuery =\n hasDebugStaticShellQuery && query.__nextppronly === 'fallback'\n\n // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the\n // prerender manifest and this is an app page.\n const isRoutePPREnabled: boolean =\n couldSupportPPR &&\n ((\n prerenderManifest.routes[normalizedSrcPage] ??\n prerenderManifest.dynamicRoutes[normalizedSrcPage]\n )?.renderingMode === 'PARTIALLY_STATIC' ||\n // Ideally we'd want to check the appConfig to see if this page has PPR\n // enabled or not, but that would require plumbing the appConfig through\n // to the server during development. We assume that the page supports it\n // but only during development.\n (hasDebugStaticShellQuery &&\n (routeModule.isDev === true ||\n routerServerContext?.experimentalTestProxy === true)))\n\n const isDebugStaticShell: boolean =\n hasDebugStaticShellQuery && isRoutePPREnabled\n\n // We should enable debugging dynamic accesses when the static shell\n // debugging has been enabled and we're also in development mode.\n const isDebugDynamicAccesses =\n isDebugStaticShell && routeModule.isDev === true\n\n const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled\n\n // If we're in minimal mode, then try to get the postponed information from\n // the request metadata. If available, use it for resuming the postponed\n // render.\n const minimalPostponed = isRoutePPREnabled\n ? getRequestMeta(req, 'postponed')\n : undefined\n\n // If PPR is enabled, and this is a RSC request (but not a prefetch), then\n // we can use this fact to only generate the flight data for the request\n // because we can't cache the HTML (as it's also dynamic).\n const isDynamicRSCRequest =\n isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest\n\n // Need to read this before it's stripped by stripFlightHeaders. We don't\n // need to transfer it to the request meta because it's only read\n // within this function; the static segment data should have already been\n // generated, so we will always either return a static response or a 404.\n const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest')\n\n // TODO: investigate existing bug with shouldServeStreamingMetadata always\n // being true for a revalidate due to modifying the base-server this.renderOpts\n // when fixing this to correct logic it causes hydration issue since we set\n // serveStreamingMetadata to true during export\n const serveStreamingMetadata =\n isHtmlBot && isRoutePPREnabled\n ? false\n : !userAgent\n ? true\n : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots)\n\n const isSSG = Boolean(\n (prerenderInfo ||\n isPrerendered ||\n prerenderManifest.routes[normalizedSrcPage]) &&\n // If this is a html bot request and PPR is enabled, then we don't want\n // to serve a static response.\n !(isHtmlBot && isRoutePPREnabled)\n )\n\n // When a page supports PPR, we can support RSC for Navigations so long as the\n // feature is not disabled.\n const supportsRSCForNavigations =\n isRoutePPREnabled &&\n nextConfig.experimental.rdcForNavigations === true &&\n // Temporarily we require that clientParamParsing is enabled for\n // RDC for Navigations. This is due to a builder configuration\n // bug that manifests as invalid query params being passed to\n // the resume lambdas.\n nextConfig.experimental.clientParamParsing === true\n\n // In development, we always want to generate dynamic HTML.\n const supportsDynamicResponse: boolean =\n // If we're in development, we always support dynamic HTML, unless it's\n // a data request, in which case we only produce static HTML.\n routeModule.isDev === true ||\n // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isSSG ||\n // If this request has provided postponed data, it supports dynamic\n // HTML.\n typeof minimalPostponed === 'string' ||\n // If this handler supports onCacheEntryV2, then we can only support\n // dynamic responses if it's a dynamic RSC request and not in minimal mode. If it\n // doesn't support it we must fallback to the default behavior.\n (supportsRSCForNavigations && getRequestMeta(req, 'onCacheEntryV2')\n ? // In minimal mode, we'll always want to generate a static response\n // which will generate the RDC for the route. When resuming a Dynamic\n // RSC request, we'll pass the minimal postponed data to the render\n // which will trigger the `supportsDynamicResponse` to be true.\n isDynamicRSCRequest && !minimalMode\n : // Otherwise, we can support dynamic responses if it's a dynamic RSC request.\n isDynamicRSCRequest)\n\n // When html bots request PPR page, perform the full dynamic rendering.\n const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled\n\n let ssgCacheKey: string | null = null\n if (\n !isDraftMode &&\n isSSG &&\n !supportsDynamicResponse &&\n !isPossibleServerAction &&\n !minimalPostponed &&\n !isDynamicRSCRequest\n ) {\n ssgCacheKey = resolvedPathname\n }\n\n // the staticPathKey differs from ssgCacheKey since\n // ssgCacheKey is null in dev since we're always in \"dynamic\"\n // mode in dev to bypass the cache, but we still need to honor\n // dynamicParams = false in dev mode\n let staticPathKey = ssgCacheKey\n if (!staticPathKey && routeModule.isDev) {\n staticPathKey = resolvedPathname\n }\n\n // If this is a request for an app path that should be statically generated\n // and we aren't in the edge runtime, strip the flight headers so it will\n // generate the static response.\n if (\n !routeModule.isDev &&\n !isDraftMode &&\n isSSG &&\n isRSCRequest &&\n !isDynamicRSCRequest\n ) {\n stripFlightHeaders(req.headers)\n }\n\n const ComponentMod = {\n ...entryBase,\n tree,\n GlobalError,\n handler,\n routeModule,\n __next_app__,\n }\n\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setReferenceManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest,\n serverModuleMap: createServerModuleMap({\n serverActionsManifest,\n }),\n })\n }\n\n const method = req.method || 'GET'\n const tracer = getTracer()\n const activeSpan = tracer.getActiveScopeSpan()\n\n try {\n const varyHeader = routeModule.getVaryHeader(\n resolvedPathname,\n interceptionRoutePatterns\n )\n res.setHeader('Vary', varyHeader)\n const invokeRouteModule = async (\n span: Span | undefined,\n context: AppPageRouteHandlerContext\n ) => {\n const nextReq = new NodeNextRequest(req)\n const nextRes = new NodeNextResponse(res)\n\n // TODO: adapt for putting the RDC inside the postponed data\n // If we're in dev, and this isn't a prefetch or a server action,\n // we should seed the resume data cache.\n if (process.env.NODE_ENV === 'development') {\n if (\n nextConfig.experimental.cacheComponents &&\n !isPrefetchRSCRequest &&\n !context.renderOpts.isPossibleServerAction\n ) {\n const warmup = await routeModule.warmup(nextReq, nextRes, context)\n\n // If the warmup is successful, we should use the resume data\n // cache from the warmup.\n if (warmup.metadata.renderResumeDataCache) {\n context.renderOpts.renderResumeDataCache =\n warmup.metadata.renderResumeDataCache\n }\n }\n }\n\n return routeModule.render(nextReq, nextRes, context).finally(() => {\n if (!span) return\n\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false,\n })\n\n const rootSpanAttributes = tracer.getRootSpanAttributes()\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return\n }\n\n if (\n rootSpanAttributes.get('next.span_type') !==\n BaseServerSpan.handleRequest\n ) {\n console.warn(\n `Unexpected root span type '${rootSpanAttributes.get(\n 'next.span_type'\n )}'. Please report this Next.js issue https://github.com/vercel/next.js`\n )\n return\n }\n\n const route = rootSpanAttributes.get('next.route')\n if (route) {\n const name = `${method} ${route}`\n\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name,\n })\n span.updateName(name)\n } else {\n span.updateName(`${method}`)\n }\n })\n }\n\n const incrementalCache = getRequestMeta(req, 'incrementalCache')\n\n const doRender = async ({\n span,\n postponed,\n fallbackRouteParams,\n forceStaticRender,\n }: {\n span?: Span\n\n /**\n * The postponed data for this render. This is only provided when resuming\n * a render that has been postponed.\n */\n postponed: string | undefined\n\n /**\n * The unknown route params for this render.\n */\n fallbackRouteParams: OpaqueFallbackRouteParams | null\n\n /**\n * When true, this indicates that the response generator is being called\n * in a context where the response must be generated statically.\n *\n * CRITICAL: This should only currently be used when revalidating due to a\n * dynamic RSC request.\n */\n forceStaticRender: boolean\n }): Promise<ResponseCacheEntry> => {\n const context: AppPageRouteHandlerContext = {\n query,\n params,\n page: normalizedSrcPage,\n sharedContext: {\n buildId,\n },\n serverComponentsHmrCache: getRequestMeta(\n req,\n 'serverComponentsHmrCache'\n ),\n fallbackRouteParams,\n renderOpts: {\n App: () => null,\n Document: () => null,\n pageConfig: {},\n ComponentMod,\n Component: interopDefault(ComponentMod),\n\n params,\n routeModule,\n page: srcPage,\n postponed,\n shouldWaitOnAllReady,\n serveStreamingMetadata,\n supportsDynamicResponse:\n typeof postponed === 'string' || supportsDynamicResponse,\n buildManifest,\n nextFontManifest,\n reactLoadableManifest,\n subresourceIntegrityManifest,\n serverActionsManifest,\n clientReferenceManifest,\n setIsrStatus: routerServerContext?.setIsrStatus,\n setReactDebugChannel: routerServerContext?.setReactDebugChannel,\n\n dir:\n process.env.NEXT_RUNTIME === 'nodejs'\n ? (require('path') as typeof import('path')).join(\n /* turbopackIgnore: true */\n process.cwd(),\n routeModule.relativeProjectDir\n )\n : `${process.cwd()}/${routeModule.relativeProjectDir}`,\n isDraftMode,\n isRevalidate: isSSG && !postponed && !isDynamicRSCRequest,\n botType,\n isOnDemandRevalidate,\n isPossibleServerAction,\n assetPrefix: nextConfig.assetPrefix,\n nextConfigOutput: nextConfig.output,\n crossOrigin: nextConfig.crossOrigin,\n trailingSlash: nextConfig.trailingSlash,\n previewProps: prerenderManifest.preview,\n deploymentId: nextConfig.deploymentId,\n enableTainting: nextConfig.experimental.taint,\n htmlLimitedBots: nextConfig.htmlLimitedBots,\n reactMaxHeadersLength: nextConfig.reactMaxHeadersLength,\n\n multiZoneDraftMode,\n incrementalCache,\n cacheLifeProfiles: nextConfig.experimental.cacheLife,\n basePath: nextConfig.basePath,\n serverActions: nextConfig.experimental.serverActions,\n\n ...(isDebugStaticShell ||\n isDebugDynamicAccesses ||\n isDebugFallbackShell\n ? {\n nextExport: true,\n supportsDynamicResponse: false,\n isStaticGeneration: true,\n isRevalidate: true,\n isDebugDynamicAccesses: isDebugDynamicAccesses,\n }\n : {}),\n\n experimental: {\n isRoutePPREnabled,\n expireTime: nextConfig.expireTime,\n staleTimes: nextConfig.experimental.staleTimes,\n cacheComponents: Boolean(nextConfig.experimental.cacheComponents),\n clientSegmentCache: Boolean(\n nextConfig.experimental.clientSegmentCache\n ),\n clientParamParsing: Boolean(\n nextConfig.experimental.clientParamParsing\n ),\n dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover),\n inlineCss: Boolean(nextConfig.experimental.inlineCss),\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts),\n clientTraceMetadata:\n nextConfig.experimental.clientTraceMetadata || ([] as any),\n clientParamParsingOrigins:\n nextConfig.experimental.clientParamParsingOrigins,\n },\n\n waitUntil: ctx.waitUntil,\n onClose: (cb) => {\n res.on('close', cb)\n },\n onAfterTaskError: () => {},\n\n onInstrumentationRequestError: (error, _request, errorContext) =>\n routeModule.onRequestError(\n req,\n error,\n errorContext,\n routerServerContext\n ),\n err: getRequestMeta(req, 'invokeError'),\n dev: routeModule.isDev,\n },\n }\n\n if (isDebugStaticShell || isDebugDynamicAccesses) {\n context.renderOpts.nextExport = true\n context.renderOpts.supportsDynamicResponse = false\n context.renderOpts.isRevalidate = true\n context.renderOpts.isDebugDynamicAccesses = isDebugDynamicAccesses\n }\n\n // When we're revalidating in the background, we should not allow dynamic\n // responses.\n if (forceStaticRender) {\n context.renderOpts.supportsDynamicResponse = false\n }\n\n const result = await invokeRouteModule(span, context)\n\n const { metadata } = result\n\n const {\n cacheControl,\n headers = {},\n // Add any fetch tags that were on the page to the response headers.\n fetchTags: cacheTags,\n fetchMetrics,\n } = metadata\n\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags\n }\n\n // Pull any fetch metrics from the render onto the request.\n ;(req as any).fetchMetrics = fetchMetrics\n\n // we don't throw static to dynamic errors in dev as isSSG\n // is a best guess in dev since we don't have the prerender pass\n // to know whether the path is actually static or not\n if (\n isSSG &&\n cacheControl?.revalidate === 0 &&\n !routeModule.isDev &&\n !isRoutePPREnabled\n ) {\n const staticBailoutInfo = metadata.staticBailoutInfo\n\n const err = new Error(\n `Page changed from static to dynamic at runtime ${resolvedPathname}${\n staticBailoutInfo?.description\n ? `, reason: ${staticBailoutInfo.description}`\n : ``\n }` +\n `\\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`\n )\n\n if (staticBailoutInfo?.stack) {\n const stack = staticBailoutInfo.stack\n err.stack = err.message + stack.substring(stack.indexOf('\\n'))\n }\n\n throw err\n }\n\n return {\n value: {\n kind: CachedRouteKind.APP_PAGE,\n html: result,\n headers,\n rscData: metadata.flightData,\n postponed: metadata.postponed,\n status: metadata.statusCode,\n segmentData: metadata.segmentData,\n } satisfies CachedAppPageValue,\n cacheControl,\n } satisfies ResponseCacheEntry\n }\n\n const responseGenerator: ResponseGenerator = async ({\n hasResolved,\n previousCacheEntry: previousIncrementalCacheEntry,\n isRevalidating,\n span,\n forceStaticRender = false,\n }) => {\n const isProduction = routeModule.isDev === false\n const didRespond = hasResolved || res.writableEnded\n\n // skip on-demand revalidate if cache is not present and\n // revalidate-if-generated is set\n if (\n isOnDemandRevalidate &&\n revalidateOnlyGenerated &&\n !previousIncrementalCacheEntry &&\n !minimalMode\n ) {\n if (routerServerContext?.render404) {\n await routerServerContext.render404(req, res)\n } else {\n res.statusCode = 404\n res.end('This page could not be found')\n }\n return null\n }\n\n let fallbackMode: FallbackMode | undefined\n\n if (prerenderInfo) {\n fallbackMode = parseFallbackField(prerenderInfo.fallback)\n }\n\n // When serving a HTML bot request, we want to serve a blocking render and\n // not the prerendered page. This ensures that the correct content is served\n // to the bot in the head.\n if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) {\n if (!isRoutePPREnabled || isHtmlBot) {\n fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER\n }\n }\n\n if (previousIncrementalCacheEntry?.isStale === -1) {\n isOnDemandRevalidate = true\n }\n\n // TODO: adapt for PPR\n // only allow on-demand revalidate for fallback: true/blocking\n // or for prerendered fallback: false paths\n if (\n isOnDemandRevalidate &&\n (fallbackMode !== FallbackMode.NOT_FOUND ||\n previousIncrementalCacheEntry)\n ) {\n fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER\n }\n\n if (\n !minimalMode &&\n fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER &&\n staticPathKey &&\n !didRespond &&\n !isDraftMode &&\n pageIsDynamic &&\n (isProduction || !isPrerendered)\n ) {\n // if the page has dynamicParams: false and this pathname wasn't\n // prerendered trigger the no fallback handling\n if (\n // In development, fall through to render to handle missing\n // getStaticPaths.\n (isProduction || prerenderInfo) &&\n // When fallback isn't present, abort this render so we 404\n fallbackMode === FallbackMode.NOT_FOUND\n ) {\n throw new NoFallbackError()\n }\n\n // When client param parsing is enabled, we can use the fallback\n // response if the request is not a dynamic RSC request because the\n // RSC data when this feature flag is enabled does not contain any\n // param references. Without this feature flag enabled, the RSC data\n // contains param references, and therefore we can't use the fallback.\n if (\n isRoutePPREnabled &&\n (nextConfig.experimental.clientParamParsing\n ? !isDynamicRSCRequest\n : !isRSCRequest)\n ) {\n const cacheKey =\n isProduction && typeof prerenderInfo?.fallback === 'string'\n ? prerenderInfo.fallback\n : normalizedSrcPage\n\n const fallbackRouteParams =\n // If we're in production and we have fallback route params, then we\n // can use the manifest fallback route params.\n isProduction && prerenderInfo?.fallbackRouteParams\n ? createOpaqueFallbackRouteParams(\n prerenderInfo.fallbackRouteParams\n )\n : // Otherwise, if we're debugging the fallback shell, then we\n // have to manually generate the fallback route params.\n isDebugFallbackShell\n ? getFallbackRouteParams(normalizedSrcPage, routeModule)\n : null\n\n // We use the response cache here to handle the revalidation and\n // management of the fallback shell.\n const fallbackResponse = await routeModule.handleResponse({\n cacheKey,\n req,\n nextConfig,\n routeKind: RouteKind.APP_PAGE,\n isFallback: true,\n prerenderManifest,\n isRoutePPREnabled,\n responseGenerator: async () =>\n doRender({\n span,\n // We pass `undefined` as rendering a fallback isn't resumed\n // here.\n postponed: undefined,\n fallbackRouteParams,\n forceStaticRender: false,\n }),\n waitUntil: ctx.waitUntil,\n })\n\n // If the fallback response was set to null, then we should return null.\n if (fallbackResponse === null) return null\n\n // Otherwise, if we did get a fallback response, we should return it.\n if (fallbackResponse) {\n // Remove the cache control from the response to prevent it from being\n // used in the surrounding cache.\n delete fallbackResponse.cacheControl\n\n return fallbackResponse\n }\n }\n }\n\n // Only requests that aren't revalidating can be resumed. If we have the\n // minimal postponed data, then we should resume the render with it.\n let postponed =\n !isOnDemandRevalidate && !isRevalidating && minimalPostponed\n ? minimalPostponed\n : undefined\n\n // If this is a dynamic RSC request, we should use the postponed data from\n // the static render (if available). This ensures that we can utilize the\n // resume data cache (RDC) from the static render to ensure that the data\n // is consistent between the static and dynamic renders.\n if (\n // Only enable RDC for Navigations if the feature is enabled.\n supportsRSCForNavigations &&\n process.env.NEXT_RUNTIME !== 'edge' &&\n !minimalMode &&\n incrementalCache &&\n isDynamicRSCRequest &&\n // We don't typically trigger an on-demand revalidation for dynamic RSC\n // requests, as we're typically revalidating the page in the background\n // instead. However, if the cache entry is stale, we should trigger a\n // background revalidation on dynamic RSC requests. This prevents us\n // from entering an infinite loop of revalidations.\n !forceStaticRender\n ) {\n const incrementalCacheEntry = await incrementalCache.get(\n resolvedPathname,\n {\n kind: IncrementalCacheKind.APP_PAGE,\n isRoutePPREnabled: true,\n isFallback: false,\n // CRITICAL: we need to allow stale here as we'll revalidate in the\n // background if it's stale. We _want_ to possibly serve a stale\n // response here as it'll be consistent with the static render.\n allowStale: true,\n }\n )\n\n // If the cache entry is found, we should use the postponed data from\n // the cache.\n if (\n incrementalCacheEntry &&\n incrementalCacheEntry.value &&\n incrementalCacheEntry.value.kind === CachedRouteKind.APP_PAGE\n ) {\n // CRITICAL: we're assigning the postponed data from the cache entry\n // here as we're using the RDC to resume the render.\n postponed = incrementalCacheEntry.value.postponed\n\n // If the cache entry is stale, we should trigger a background\n // revalidation so that subsequent requests will get a fresh response.\n if (\n incrementalCacheEntry &&\n // We want to trigger this flow if the cache entry is stale and if\n // the requested revalidation flow is either foreground or\n // background.\n (incrementalCacheEntry.isStale === -1 ||\n incrementalCacheEntry.isStale === true)\n ) {\n // We want to schedule this on the next tick to ensure that the\n // render is not blocked on it.\n scheduleOnNextTick(async () => {\n const responseCache = routeModule.getResponseCache(req)\n\n try {\n await responseCache.revalidate(\n resolvedPathname,\n incrementalCache,\n isRoutePPREnabled,\n false,\n (c) =>\n responseGenerator({\n ...c,\n // CRITICAL: we need to set this to true as we're\n // revalidating in the background and typically this dynamic\n // RSC request is not treated as static.\n forceStaticRender: true,\n }),\n // CRITICAL: we need to pass null here because passing the\n // previous cache entry here (which is stale) will switch on\n // isOnDemandRevalidate and break the prerendering.\n null,\n hasResolved,\n ctx.waitUntil\n )\n } catch (err) {\n console.error(\n 'Error revalidating the page in the background',\n err\n )\n }\n })\n }\n }\n }\n\n // When we're in minimal mode, if we're trying to debug the static shell,\n // we should just return nothing instead of resuming the dynamic render.\n if (\n (isDebugStaticShell || isDebugDynamicAccesses) &&\n typeof postponed !== 'undefined'\n ) {\n return {\n cacheControl: { revalidate: 1, expire: undefined },\n value: {\n kind: CachedRouteKind.PAGES,\n html: RenderResult.EMPTY,\n pageData: {},\n headers: undefined,\n status: undefined,\n } satisfies CachedPageValue,\n }\n }\n\n const fallbackRouteParams =\n // If we're in production and we have fallback route params, then we\n // can use the manifest fallback route params if we need to render the\n // fallback shell.\n isProduction &&\n prerenderInfo?.fallbackRouteParams &&\n getRequestMeta(req, 'renderFallbackShell')\n ? createOpaqueFallbackRouteParams(prerenderInfo.fallbackRouteParams)\n : // Otherwise, if we're debugging the fallback shell, then we have to\n // manually generate the fallback route params.\n isDebugFallbackShell\n ? getFallbackRouteParams(normalizedSrcPage, routeModule)\n : null\n\n // Perform the render.\n return doRender({\n span,\n postponed,\n fallbackRouteParams,\n forceStaticRender,\n })\n }\n\n const handleResponse = async (span?: Span): Promise<null | void> => {\n const cacheEntry = await routeModule.handleResponse({\n cacheKey: ssgCacheKey,\n responseGenerator: (c) =>\n responseGenerator({\n span,\n ...c,\n }),\n routeKind: RouteKind.APP_PAGE,\n isOnDemandRevalidate,\n isRoutePPREnabled,\n req,\n nextConfig,\n prerenderManifest,\n waitUntil: ctx.waitUntil,\n })\n\n if (isDraftMode) {\n res.setHeader(\n 'Cache-Control',\n 'private, no-cache, no-store, max-age=0, must-revalidate'\n )\n }\n\n // In dev, we should not cache pages for any reason.\n if (routeModule.isDev) {\n res.setHeader('Cache-Control', 'no-store, must-revalidate')\n }\n\n if (!cacheEntry) {\n if (ssgCacheKey) {\n // A cache entry might not be generated if a response is written\n // in `getInitialProps` or `getServerSideProps`, but those shouldn't\n // have a cache key. If we do have a cache key but we don't end up\n // with a cache entry, then either Next.js or the application has a\n // bug that needs fixing.\n throw new Error('invariant: cache entry required but not generated')\n }\n return null\n }\n\n if (cacheEntry.value?.kind !== CachedRouteKind.APP_PAGE) {\n throw new Error(\n `Invariant app-page handler received invalid cache entry ${cacheEntry.value?.kind}`\n )\n }\n\n const didPostpone = typeof cacheEntry.value.postponed === 'string'\n\n if (\n isSSG &&\n // We don't want to send a cache header for requests that contain dynamic\n // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC\n // request, then we should set the cache header.\n !isDynamicRSCRequest &&\n (!didPostpone || isPrefetchRSCRequest)\n ) {\n if (!minimalMode) {\n // set x-nextjs-cache header to match the header\n // we set for the image-optimizer\n res.setHeader(\n 'x-nextjs-cache',\n isOnDemandRevalidate\n ? 'REVALIDATED'\n : cacheEntry.isMiss\n ? 'MISS'\n : cacheEntry.isStale\n ? 'STALE'\n : 'HIT'\n )\n }\n // Set a header used by the client router to signal the response is static\n // and should respect the `static` cache staleTime value.\n res.setHeader(NEXT_IS_PRERENDER_HEADER, '1')\n }\n const { value: cachedData } = cacheEntry\n\n // Coerce the cache control parameter from the render.\n let cacheControl: CacheControl | undefined\n\n // If this is a resume request in minimal mode it is streamed with dynamic\n // content and should not be cached.\n if (minimalPostponed) {\n cacheControl = { revalidate: 0, expire: undefined }\n }\n\n // If this is in minimal mode and this is a flight request that isn't a\n // prefetch request while PPR is enabled, it cannot be cached as it contains\n // dynamic content.\n else if (isDynamicRSCRequest) {\n cacheControl = { revalidate: 0, expire: undefined }\n } else if (!routeModule.isDev) {\n // If this is a preview mode request, we shouldn't cache it\n if (isDraftMode) {\n cacheControl = { revalidate: 0, expire: undefined }\n }\n\n // If this isn't SSG, then we should set change the header only if it is\n // not set already.\n else if (!isSSG) {\n if (!res.getHeader('Cache-Control')) {\n cacheControl = { revalidate: 0, expire: undefined }\n }\n } else if (cacheEntry.cacheControl) {\n // If the cache entry has a cache control with a revalidate value that's\n // a number, use it.\n if (typeof cacheEntry.cacheControl.revalidate === 'number') {\n if (cacheEntry.cacheControl.revalidate < 1) {\n throw new Error(\n `Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`\n )\n }\n\n cacheControl = {\n revalidate: cacheEntry.cacheControl.revalidate,\n expire: cacheEntry.cacheControl?.expire ?? nextConfig.expireTime,\n }\n }\n // Otherwise if the revalidate value is false, then we should use the\n // cache time of one year.\n else {\n cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }\n }\n }\n }\n\n cacheEntry.cacheControl = cacheControl\n\n if (\n typeof segmentPrefetchHeader === 'string' &&\n cachedData?.kind === CachedRouteKind.APP_PAGE &&\n cachedData.segmentData\n ) {\n // This is a prefetch request issued by the client Segment Cache. These\n // should never reach the application layer (lambda). We should either\n // respond from the cache (HIT) or respond with 204 No Content (MISS).\n\n // Set a header to indicate that PPR is enabled for this route. This\n // lets the client distinguish between a regular cache miss and a cache\n // miss due to PPR being disabled. In other contexts this header is used\n // to indicate that the response contains dynamic data, but here we're\n // only using it to indicate that the feature is enabled — the segment\n // response itself contains whether the data is dynamic.\n res.setHeader(NEXT_DID_POSTPONE_HEADER, '2')\n\n // Add the cache tags header to the response if it exists and we're in\n // minimal mode while rendering a static page.\n const tags = cachedData.headers?.[NEXT_CACHE_TAGS_HEADER]\n if (minimalMode && isSSG && tags && typeof tags === 'string') {\n res.setHeader(NEXT_CACHE_TAGS_HEADER, tags)\n }\n\n const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader)\n if (matchedSegment !== undefined) {\n // Cache hit\n return sendRenderResult({\n req,\n res,\n generateEtags: nextConfig.generateEtags,\n poweredByHeader: nextConfig.poweredByHeader,\n result: RenderResult.fromStatic(\n matchedSegment,\n RSC_CONTENT_TYPE_HEADER\n ),\n cacheControl: cacheEntry.cacheControl,\n })\n }\n\n // Cache miss. Either a cache entry for this route has not been generated\n // (which technically should not be possible when PPR is enabled, because\n // at a minimum there should always be a fallback entry) or there's no\n // match for the requested segment. Respond with a 204 No Content. We\n // don't bother to respond with 404, because these requests are only\n // issued as part of a prefetch.\n res.statusCode = 204\n return sendRenderResult({\n req,\n res,\n generateEtags: nextConfig.generateEtags,\n poweredByHeader: nextConfig.poweredByHeader,\n result: RenderResult.EMPTY,\n cacheControl: cacheEntry.cacheControl,\n })\n }\n\n // If there's a callback for `onCacheEntry`, call it with the cache entry\n // and the revalidate options. If we support RDC for Navigations, we\n // prefer the `onCacheEntryV2` callback. Once RDC for Navigations is the\n // default, we can remove the fallback to `onCacheEntry` as\n // `onCacheEntryV2` is now fully supported.\n const onCacheEntry = supportsRSCForNavigations\n ? (getRequestMeta(req, 'onCacheEntryV2') ??\n getRequestMeta(req, 'onCacheEntry'))\n : getRequestMeta(req, 'onCacheEntry')\n if (onCacheEntry) {\n const finished = await onCacheEntry(cacheEntry, {\n url: getRequestMeta(req, 'initURL') ?? req.url,\n })\n if (finished) return null\n }\n\n if (cachedData.headers) {\n const headers = { ...cachedData.headers }\n\n if (!minimalMode || !isSSG) {\n delete headers[NEXT_CACHE_TAGS_HEADER]\n }\n\n for (let [key, value] of Object.entries(headers)) {\n if (typeof value === 'undefined') continue\n\n if (Array.isArray(value)) {\n for (const v of value) {\n res.appendHeader(key, v)\n }\n } else if (typeof value === 'number') {\n value = value.toString()\n res.appendHeader(key, value)\n } else {\n res.appendHeader(key, value)\n }\n }\n }\n\n // Add the cache tags header to the response if it exists and we're in\n // minimal mode while rendering a static page.\n const tags = cachedData.headers?.[NEXT_CACHE_TAGS_HEADER]\n if (minimalMode && isSSG && tags && typeof tags === 'string') {\n res.setHeader(NEXT_CACHE_TAGS_HEADER, tags)\n }\n\n // If the request is a data request, then we shouldn't set the status code\n // from the response because it should always be 200. This should be gated\n // behind the experimental PPR flag.\n if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) {\n res.statusCode = cachedData.status\n }\n\n // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes\n if (\n !minimalMode &&\n cachedData.status &&\n RedirectStatusCode[cachedData.status] &&\n isRSCRequest\n ) {\n res.statusCode = 200\n }\n\n // Mark that the request did postpone.\n if (didPostpone && !isDynamicRSCRequest) {\n res.setHeader(NEXT_DID_POSTPONE_HEADER, '1')\n }\n\n // we don't go through this block when preview mode is true\n // as preview mode is a dynamic request (bypasses cache) and doesn't\n // generate both HTML and payloads in the same request so continue to just\n // return the generated payload\n if (isRSCRequest && !isDraftMode) {\n // If this is a dynamic RSC request, then stream the response.\n if (typeof cachedData.rscData === 'undefined') {\n // If the response is not an RSC response, then we can't serve it.\n if (cachedData.html.contentType !== RSC_CONTENT_TYPE_HEADER) {\n if (nextConfig.experimental.clientParamParsing) {\n // If client param parsing is enabled, then we can return a 404.\n // This was likely an old prefetch request.\n res.statusCode = 404\n return sendRenderResult({\n req,\n res,\n generateEtags: nextConfig.generateEtags,\n poweredByHeader: nextConfig.poweredByHeader,\n result: RenderResult.EMPTY,\n cacheControl: cacheEntry.cacheControl,\n })\n } else {\n // Otherwise this case is not expected.\n throw new InvariantError(\n `Expected RSC response, got ${cachedData.html.contentType}`\n )\n }\n }\n\n return sendRenderResult({\n req,\n res,\n generateEtags: nextConfig.generateEtags,\n poweredByHeader: nextConfig.poweredByHeader,\n result: cachedData.html,\n cacheControl: cacheEntry.cacheControl,\n })\n }\n\n // As this isn't a prefetch request, we should serve the static flight\n // data.\n return sendRenderResult({\n req,\n res,\n generateEtags: nextConfig.generateEtags,\n poweredByHeader: nextConfig.poweredByHeader,\n result: RenderResult.fromStatic(\n cachedData.rscData,\n RSC_CONTENT_TYPE_HEADER\n ),\n cacheControl: cacheEntry.cacheControl,\n })\n }\n\n // This is a request for HTML data.\n const body = cachedData.html\n\n // If there's no postponed state, we should just serve the HTML. This\n // should also be the case for a resume request because it's completed\n // as a server render (rather than a static render).\n if (!didPostpone || minimalMode || isRSCRequest) {\n // If we're in test mode, we should add a sentinel chunk to the response\n // that's between the static and dynamic parts so we can compare the\n // chunks and add assertions.\n if (\n process.env.__NEXT_TEST_MODE &&\n minimalMode &&\n isRoutePPREnabled &&\n body.contentType === HTML_CONTENT_TYPE_HEADER\n ) {\n // As we're in minimal mode, the static part would have already been\n // streamed first. The only part that this streams is the dynamic part\n // so we should FIRST stream the sentinel and THEN the dynamic part.\n body.unshift(createPPRBoundarySentinel())\n }\n\n return sendRenderResult({\n req,\n res,\n generateEtags: nextConfig.generateEtags,\n poweredByHeader: nextConfig.poweredByHeader,\n result: body,\n cacheControl: cacheEntry.cacheControl,\n })\n }\n\n // If we're debugging the static shell or the dynamic API accesses, we\n // should just serve the HTML without resuming the render. The returned\n // HTML will be the static shell so all the Dynamic API's will be used\n // during static generation.\n if (isDebugStaticShell || isDebugDynamicAccesses) {\n // Since we're not resuming the render, we need to at least add the\n // closing body and html tags to create valid HTML.\n body.push(\n new ReadableStream({\n start(controller) {\n controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML)\n controller.close()\n },\n })\n )\n\n return sendRenderResult({\n req,\n res,\n generateEtags: nextConfig.generateEtags,\n poweredByHeader: nextConfig.poweredByHeader,\n result: body,\n cacheControl: { revalidate: 0, expire: undefined },\n })\n }\n\n // If we're in test mode, we should add a sentinel chunk to the response\n // that's between the static and dynamic parts so we can compare the\n // chunks and add assertions.\n if (process.env.__NEXT_TEST_MODE) {\n body.push(createPPRBoundarySentinel())\n }\n\n // This request has postponed, so let's create a new transformer that the\n // dynamic data can pipe to that will attach the dynamic data to the end\n // of the response.\n const transformer = new TransformStream<Uint8Array, Uint8Array>()\n body.push(transformer.readable)\n\n // Perform the render again, but this time, provide the postponed state.\n // We don't await because we want the result to start streaming now, and\n // we've already chained the transformer's readable to the render result.\n doRender({\n span,\n postponed: cachedData.postponed,\n // This is a resume render, not a fallback render, so we don't need to\n // set this.\n fallbackRouteParams: null,\n forceStaticRender: false,\n })\n .then(async (result) => {\n if (!result) {\n throw new Error('Invariant: expected a result to be returned')\n }\n\n if (result.value?.kind !== CachedRouteKind.APP_PAGE) {\n throw new Error(\n `Invariant: expected a page response, got ${result.value?.kind}`\n )\n }\n\n // Pipe the resume result to the transformer.\n await result.value.html.pipeTo(transformer.writable)\n })\n .catch((err) => {\n // An error occurred during piping or preparing the render, abort\n // the transformers writer so we can terminate the stream.\n transformer.writable.abort(err).catch((e) => {\n console.error(\"couldn't abort transformer\", e)\n })\n })\n\n return sendRenderResult({\n req,\n res,\n generateEtags: nextConfig.generateEtags,\n poweredByHeader: nextConfig.poweredByHeader,\n result: body,\n // We don't want to cache the response if it has postponed data because\n // the response being sent to the client it's dynamic parts are streamed\n // to the client on the same request.\n cacheControl: { revalidate: 0, expire: undefined },\n })\n }\n\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (activeSpan) {\n await handleResponse(activeSpan)\n } else {\n return await tracer.withPropagatedContext(req.headers, () =>\n tracer.trace(\n BaseServerSpan.handleRequest,\n {\n spanName: `${method}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url,\n },\n },\n handleResponse\n )\n )\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n await routeModule.onRequestError(\n req,\n err,\n {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'render',\n revalidateReason: getRevalidateReason({\n isRevalidate: isSSG,\n isOnDemandRevalidate,\n }),\n },\n routerServerContext\n )\n }\n\n // rethrow so that we can handle serving error page\n throw err\n }\n}\n\n// TODO: omit this from production builds, only test builds should include it\n/**\n * Creates a readable stream that emits a PPR boundary sentinel.\n *\n * @returns A readable stream that emits a PPR boundary sentinel.\n */\nfunction createPPRBoundarySentinel() {\n return new ReadableStream({\n start(controller) {\n controller.enqueue(\n new TextEncoder().encode('<!-- PPR_BOUNDARY_SENTINEL -->')\n )\n controller.close()\n },\n })\n}\n"],"names":["GlobalError","__next_app__","handler","routeModule","require","__next_app_require__","loadChunk","__next_app_load_chunk__","AppPageRouteModule","definition","kind","RouteKind","APP_PAGE","page","pathname","bundlePath","filename","appPaths","userland","loaderTree","tree","distDir","process","env","__NEXT_RELATIVE_DIST_DIR","relativeProjectDir","__NEXT_RELATIVE_PROJECT_DIR","req","res","ctx","prerenderManifest","srcPage","TURBOPACK","replace","multiZoneDraftMode","__NEXT_MULTI_ZONE_DRAFT_MODE","minimalMode","getRequestMeta","prepareResult","prepare","statusCode","end","waitUntil","Promise","resolve","buildId","query","params","pageIsDynamic","buildManifest","nextFontManifest","reactLoadableManifest","serverActionsManifest","clientReferenceManifest","subresourceIntegrityManifest","isDraftMode","resolvedPathname","revalidateOnlyGenerated","routerServerContext","nextConfig","interceptionRoutePatterns","normalizedSrcPage","normalizeAppPath","isOnDemandRevalidate","prerenderInfo","experimental","ppr","cacheComponents","isInterceptionRouteAppPath","match","isPrerendered","routes","userAgent","headers","botType","getBotType","isHtmlBot","isHtmlBotRequest","isPrefetchRSCRequest","NEXT_ROUTER_PREFETCH_HEADER","isRSCRequest","Boolean","RSC_HEADER","isPossibleServerAction","getIsPossibleServerAction","couldSupportPPR","checkIsAppPPREnabled","hasDebugStaticShellQuery","__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING","__nextppronly","hasDebugFallbackShellQuery","isRoutePPREnabled","dynamicRoutes","renderingMode","isDev","experimentalTestProxy","isDebugStaticShell","isDebugDynamicAccesses","isDebugFallbackShell","minimalPostponed","undefined","isDynamicRSCRequest","segmentPrefetchHeader","serveStreamingMetadata","shouldServeStreamingMetadata","htmlLimitedBots","isSSG","supportsRSCForNavigations","rdcForNavigations","clientParamParsing","supportsDynamicResponse","shouldWaitOnAllReady","ssgCacheKey","staticPathKey","stripFlightHeaders","ComponentMod","entryBase","setReferenceManifestsSingleton","serverModuleMap","createServerModuleMap","method","tracer","getTracer","activeSpan","getActiveScopeSpan","varyHeader","getVaryHeader","setHeader","invokeRouteModule","span","context","nextReq","NodeNextRequest","nextRes","NodeNextResponse","NODE_ENV","renderOpts","warmup","metadata","renderResumeDataCache","render","finally","setAttributes","rootSpanAttributes","getRootSpanAttributes","get","BaseServerSpan","handleRequest","console","warn","route","name","updateName","incrementalCache","doRender","postponed","fallbackRouteParams","forceStaticRender","sharedContext","serverComponentsHmrCache","App","Document","pageConfig","Component","interopDefault","setIsrStatus","setReactDebugChannel","dir","NEXT_RUNTIME","join","cwd","isRevalidate","assetPrefix","nextConfigOutput","output","crossOrigin","trailingSlash","previewProps","preview","deploymentId","enableTainting","taint","reactMaxHeadersLength","cacheLifeProfiles","cacheLife","basePath","serverActions","nextExport","isStaticGeneration","expireTime","staleTimes","clientSegmentCache","dynamicOnHover","inlineCss","authInterrupts","clientTraceMetadata","clientParamParsingOrigins","onClose","cb","on","onAfterTaskError","onInstrumentationRequestError","error","_request","errorContext","onRequestError","err","dev","result","cacheControl","fetchTags","cacheTags","fetchMetrics","NEXT_CACHE_TAGS_HEADER","revalidate","staticBailoutInfo","Error","description","stack","message","substring","indexOf","value","CachedRouteKind","html","rscData","flightData","status","segmentData","responseGenerator","hasResolved","previousCacheEntry","previousIncrementalCacheEntry","isRevalidating","isProduction","didRespond","writableEnded","render404","fallbackMode","parseFallbackField","fallback","FallbackMode","PRERENDER","isBot","BLOCKING_STATIC_RENDER","isStale","NOT_FOUND","NoFallbackError","cacheKey","createOpaqueFallbackRouteParams","getFallbackRouteParams","fallbackResponse","handleResponse","routeKind","isFallback","incrementalCacheEntry","IncrementalCacheKind","allowStale","scheduleOnNextTick","responseCache","getResponseCache","c","expire","PAGES","RenderResult","EMPTY","pageData","cacheEntry","cachedData","didPostpone","isMiss","NEXT_IS_PRERENDER_HEADER","getHeader","CACHE_ONE_YEAR","NEXT_DID_POSTPONE_HEADER","tags","matchedSegment","sendRenderResult","generateEtags","poweredByHeader","fromStatic","RSC_CONTENT_TYPE_HEADER","onCacheEntry","finished","url","key","Object","entries","Array","isArray","v","appendHeader","toString","RedirectStatusCode","contentType","InvariantError","body","__NEXT_TEST_MODE","HTML_CONTENT_TYPE_HEADER","unshift","createPPRBoundarySentinel","push","ReadableStream","start","controller","enqueue","ENCODED_TAGS","CLOSED","BODY_AND_HTML","close","transformer","TransformStream","readable","then","pipeTo","writable","catch","abort","e","withPropagatedContext","trace","spanName","SpanKind","SERVER","attributes","routerKind","routePath","routeType","revalidateReason","getRevalidateReason","TextEncoder","encode"],"mappings":";;;;;;;;;;;;;;;;;IAyESA,WAAW;eAAXA,gCAAW;;IASPC,YAAY;eAAZA;;IA+BSC,OAAO;eAAPA;;IAjBTC,WAAW;eAAXA;;;;gCA1FN;2BAEmB;uBAEU;wBACW;6BAChB;2BACA;gCACA;oCACI;sB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rC,MAAMpP,YAAY0M,cAAc,CAC9BlL,KACAmL,KACA;gBACEuH,YAAY;gBACZC,WAAWvS;gBACXwS,WAAW;gBACXC,kBAAkBC,IAAAA,0BAAmB,EAAC;oBACpC9J,cAAcjE;oBACd3C;gBACF;YACF,GACAL;QAEJ;QAEA,mDAAmD;QACnD,MAAMoJ;IACR;AACF;AAEA,6EAA6E;AAC7E;;;;CAIC,GACD,SAAS8F;IACP,OAAO,IAAIE,eAAe;QACxBC,OAAMC,UAAU;YACdA,WAAWC,OAAO,CAChB,IAAIyB,cAAcC,MAAM,CAAC;YAE3B3B,WAAWK,KAAK;QAClB;IACF;AACF","ignoreList":[0]}
@@ -242,7 +242,7 @@ async function handler(req, res, ctx) {
242
242
  });
243
243
  span.updateName(name);
244
244
  } else {
245
- span.updateName(`${method} ${req.url}`);
245
+ span.updateName(`${method}`);
246
246
  }
247
247
  });
248
248
  };
@@ -372,7 +372,7 @@ async function handler(req, res, ctx) {
372
372
  await handleResponse(activeSpan);
373
373
  } else {
374
374
  await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(_constants.BaseServerSpan.handleRequest, {
375
- spanName: `${method} ${req.url}`,
375
+ spanName: `${method}`,
376
376
  kind: _tracer.SpanKind.SERVER,
377
377
  attributes: {
378
378
  'http.method': method,