next 15.6.0-canary.2 → 15.6.0-canary.4
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.
- package/dist/bin/next +1 -1
- package/dist/build/adapter/build-complete.js +1 -1
- package/dist/build/adapter/build-complete.js.map +1 -1
- package/dist/build/index.js +9 -5
- package/dist/build/index.js.map +1 -1
- package/dist/build/swc/index.js +1 -1
- package/dist/build/templates/app-page.js +5 -1
- package/dist/build/templates/app-page.js.map +1 -1
- package/dist/build/webpack/loaders/devtool/devtool-style-inject.js +31 -26
- package/dist/build/webpack/loaders/devtool/devtool-style-inject.js.map +1 -1
- package/dist/build/webpack-config.js +2 -2
- package/dist/client/app-bootstrap.js +1 -1
- package/dist/client/index.js +1 -1
- package/dist/compiled/next-devtools/index.js +1 -1
- package/dist/compiled/next-devtools/index.js.map +1 -1
- package/dist/compiled/next-server/server.runtime.prod.js +5 -5
- package/dist/compiled/next-server/server.runtime.prod.js.map +1 -1
- package/dist/esm/build/adapter/build-complete.js +1 -1
- package/dist/esm/build/adapter/build-complete.js.map +1 -1
- package/dist/esm/build/index.js +9 -5
- package/dist/esm/build/index.js.map +1 -1
- package/dist/esm/build/swc/index.js +1 -1
- package/dist/esm/build/templates/app-page.js +5 -1
- package/dist/esm/build/templates/app-page.js.map +1 -1
- package/dist/esm/build/webpack/loaders/devtool/devtool-style-inject.js +31 -26
- package/dist/esm/build/webpack/loaders/devtool/devtool-style-inject.js.map +1 -1
- package/dist/esm/build/webpack-config.js +2 -2
- package/dist/esm/client/app-bootstrap.js +1 -1
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/esm/server/lib/app-info-log.js +1 -1
- package/dist/esm/server/lib/router-utils/setup-dev-bundler.js +1 -1
- package/dist/esm/server/lib/router-utils/setup-dev-bundler.js.map +1 -1
- package/dist/esm/server/lib/start-server.js +1 -1
- package/dist/esm/server/node-environment-extensions/unhandled-rejection.js +50 -1
- package/dist/esm/server/node-environment-extensions/unhandled-rejection.js.map +1 -1
- package/dist/esm/shared/lib/canary-only.js +1 -1
- package/dist/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/server/lib/app-info-log.js +1 -1
- package/dist/server/lib/router-utils/setup-dev-bundler.js +1 -1
- package/dist/server/lib/router-utils/setup-dev-bundler.js.map +1 -1
- package/dist/server/lib/start-server.js +1 -1
- package/dist/server/node-environment-extensions/unhandled-rejection.js +50 -1
- package/dist/server/node-environment-extensions/unhandled-rejection.js.map +1 -1
- package/dist/shared/lib/canary-only.js +1 -1
- package/dist/telemetry/anonymous-meta.js +1 -1
- package/dist/telemetry/events/session-stopped.js +2 -2
- package/dist/telemetry/events/version.js +2 -2
- package/package.json +15 -15
package/dist/build/swc/index.js
CHANGED
@@ -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.
|
134
|
+
const nextVersion = "15.6.0-canary.4";
|
135
135
|
const ArchName = (0, _os.arch)();
|
136
136
|
const PlatformName = (0, _os.platform)();
|
137
137
|
function infoLog(...args) {
|
@@ -232,7 +232,11 @@ async function handler(req, res, ctx) {
|
|
232
232
|
!(isHtmlBot && isRoutePPREnabled));
|
233
233
|
// When a page supports PPR, we can support RSC for Navigations so long as the
|
234
234
|
// feature is not disabled.
|
235
|
-
const supportsRSCForNavigations = isRoutePPREnabled && nextConfig.experimental.rdcForNavigations === true
|
235
|
+
const supportsRSCForNavigations = isRoutePPREnabled && nextConfig.experimental.rdcForNavigations === true && // Temporarily we require that clientParamParsing is enabled for
|
236
|
+
// RDC for Navigations. This is due to a builder configuration
|
237
|
+
// bug that manifests as invalid query params being passed to
|
238
|
+
// the resume lambdas.
|
239
|
+
nextConfig.experimental.clientParamParsing === true;
|
236
240
|
// In development, we always want to generate dynamic HTML.
|
237
241
|
const supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's
|
238
242
|
// a data request, in which case we only produce static HTML.
|
@@ -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 && nextConfig.experimental.rdcForNavigations === 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","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","clientParamParsing","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;2B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QAEA,mDAAmD;QACnD,MAAMqJ;IACR;AACF;AAEA,6EAA6E;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} ${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;eA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Ae7F,IAAI8H,GAAG;oBACxB;gBACF,GACAoG;QAGN;IACF,EAAE,OAAO9C,KAAK;QACZ,IAAI,CAAEA,CAAAA,eAAeyC,wCAAe,AAAD,GAAI;YACrC,MAAMrP,YAAY2M,cAAc,CAC9BnL,KACAoL,KACA;gBACEsH,YAAY;gBACZC,WAAWvS;gBACXwS,WAAW;gBACXC,kBAAkBC,IAAAA,0BAAmB,EAAC;oBACpC7J,cAAclE;oBACd3C;gBACF;YACF,GACAL;QAEJ;QAEA,mDAAmD;QACnD,MAAMqJ;IACR;AACF;AAEA,6EAA6E;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]}
|
@@ -67,35 +67,40 @@ function startObservingForPortal() {
|
|
67
67
|
}
|
68
68
|
// Set up MutationObserver to watch for the portal element
|
69
69
|
const observer = new MutationObserver((mutations)=>{
|
70
|
-
if (mutations.length === 0
|
70
|
+
if (mutations.length === 0) {
|
71
71
|
return;
|
72
72
|
}
|
73
|
-
// Check
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
73
|
+
// Check all mutations and all added nodes
|
74
|
+
for (const mutation of mutations){
|
75
|
+
if (mutation.addedNodes.length === 0) continue;
|
76
|
+
for (const addedNode of mutation.addedNodes){
|
77
|
+
if (addedNode.nodeType !== Node.ELEMENT_NODE) continue;
|
78
|
+
const mutationNode = addedNode;
|
79
|
+
let portalNode = null;
|
80
|
+
if (// app router: body > script[data-nextjs-dev-overlay] > nextjs-portal
|
81
|
+
mutationNode.tagName === 'SCRIPT' && mutationNode.getAttribute('data-nextjs-dev-overlay')) {
|
82
|
+
portalNode = mutationNode.firstChild;
|
83
|
+
} else if (// pages router: body > nextjs-portal
|
84
|
+
mutationNode.tagName === 'NEXTJS-PORTAL') {
|
85
|
+
portalNode = mutationNode;
|
86
|
+
}
|
87
|
+
if (portalNode) {
|
88
|
+
// Wait until shadow root is available
|
89
|
+
const checkShadowRoot = ()=>{
|
90
|
+
if (getShadowRoot()) {
|
91
|
+
flushCachedElements();
|
92
|
+
observer.disconnect();
|
93
|
+
cache.isObserving = false;
|
94
|
+
} else {
|
95
|
+
// Try again after a short delay
|
96
|
+
setTimeout(checkShadowRoot, 20);
|
97
|
+
}
|
98
|
+
};
|
99
|
+
checkShadowRoot();
|
100
|
+
return; // Exit early once we find a portal
|
101
|
+
}
|
96
102
|
}
|
97
|
-
}
|
98
|
-
checkShadowRoot();
|
103
|
+
}
|
99
104
|
});
|
100
105
|
observer.observe(document.body, {
|
101
106
|
childList: true,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../../src/build/webpack/loaders/devtool/devtool-style-inject.js"],"sourcesContent":["/* @ts-check */\n/**\n * Style injection mechanism for Next.js devtools with shadow DOM support\n * Handles caching of style elements when the nextjs-portal shadow root is not available\n */\n\n// Global cache for style elements when shadow root is not available\nif (typeof window !== 'undefined') {\n window._nextjsDevtoolsStyleCache = window._nextjsDevtoolsStyleCache || {\n pendingElements: [],\n isObserving: false,\n lastInsertedElement: null,\n cachedShadowRoot: null, // Cache the shadow root once found\n }\n}\n\n/**\n * @returns {ShadowRoot | null}\n */\nfunction getShadowRoot() {\n const cache = window._nextjsDevtoolsStyleCache\n\n // Return cached shadow root if available\n if (cache.cachedShadowRoot) {\n return cache.cachedShadowRoot\n }\n\n // Query the DOM and cache the result if found\n const portal = document.querySelector('nextjs-portal')\n const shadowRoot = portal?.shadowRoot || null\n\n if (shadowRoot) {\n cache.cachedShadowRoot = shadowRoot\n }\n\n return shadowRoot\n}\n\n/**\n * @param {HTMLElement} element\n * @param {ShadowRoot} shadowRoot\n */\nfunction insertElementIntoShadowRoot(element, shadowRoot) {\n const cache = window._nextjsDevtoolsStyleCache\n\n if (!cache.lastInsertedElement) {\n shadowRoot.insertBefore(element, shadowRoot.firstChild)\n } else if (cache.lastInsertedElement.nextSibling) {\n shadowRoot.insertBefore(element, cache.lastInsertedElement.nextSibling)\n } else {\n shadowRoot.appendChild(element)\n }\n\n cache.lastInsertedElement = element\n}\n\nfunction flushCachedElements() {\n const cache = window._nextjsDevtoolsStyleCache\n const shadowRoot = getShadowRoot()\n\n if (!shadowRoot) {\n return\n }\n\n cache.pendingElements.forEach((element) => {\n insertElementIntoShadowRoot(element, shadowRoot)\n })\n cache.pendingElements = []\n}\n\nfunction startObservingForPortal() {\n const cache = window._nextjsDevtoolsStyleCache\n\n if (cache.isObserving) {\n return\n }\n cache.isObserving = true\n\n // First check if the portal already exists\n const shadowRoot = getShadowRoot() // This will cache it if found\n if (shadowRoot) {\n flushCachedElements()\n return\n }\n\n // Set up MutationObserver to watch for the portal element\n const observer = new MutationObserver((mutations) => {\n if (mutations.length === 0
|
1
|
+
{"version":3,"sources":["../../../../../src/build/webpack/loaders/devtool/devtool-style-inject.js"],"sourcesContent":["/* @ts-check */\n/**\n * Style injection mechanism for Next.js devtools with shadow DOM support\n * Handles caching of style elements when the nextjs-portal shadow root is not available\n */\n\n// Global cache for style elements when shadow root is not available\nif (typeof window !== 'undefined') {\n window._nextjsDevtoolsStyleCache = window._nextjsDevtoolsStyleCache || {\n pendingElements: [],\n isObserving: false,\n lastInsertedElement: null,\n cachedShadowRoot: null, // Cache the shadow root once found\n }\n}\n\n/**\n * @returns {ShadowRoot | null}\n */\nfunction getShadowRoot() {\n const cache = window._nextjsDevtoolsStyleCache\n\n // Return cached shadow root if available\n if (cache.cachedShadowRoot) {\n return cache.cachedShadowRoot\n }\n\n // Query the DOM and cache the result if found\n const portal = document.querySelector('nextjs-portal')\n const shadowRoot = portal?.shadowRoot || null\n\n if (shadowRoot) {\n cache.cachedShadowRoot = shadowRoot\n }\n\n return shadowRoot\n}\n\n/**\n * @param {HTMLElement} element\n * @param {ShadowRoot} shadowRoot\n */\nfunction insertElementIntoShadowRoot(element, shadowRoot) {\n const cache = window._nextjsDevtoolsStyleCache\n\n if (!cache.lastInsertedElement) {\n shadowRoot.insertBefore(element, shadowRoot.firstChild)\n } else if (cache.lastInsertedElement.nextSibling) {\n shadowRoot.insertBefore(element, cache.lastInsertedElement.nextSibling)\n } else {\n shadowRoot.appendChild(element)\n }\n\n cache.lastInsertedElement = element\n}\n\nfunction flushCachedElements() {\n const cache = window._nextjsDevtoolsStyleCache\n const shadowRoot = getShadowRoot()\n\n if (!shadowRoot) {\n return\n }\n\n cache.pendingElements.forEach((element) => {\n insertElementIntoShadowRoot(element, shadowRoot)\n })\n cache.pendingElements = []\n}\n\nfunction startObservingForPortal() {\n const cache = window._nextjsDevtoolsStyleCache\n\n if (cache.isObserving) {\n return\n }\n cache.isObserving = true\n\n // First check if the portal already exists\n const shadowRoot = getShadowRoot() // This will cache it if found\n if (shadowRoot) {\n flushCachedElements()\n return\n }\n\n // Set up MutationObserver to watch for the portal element\n const observer = new MutationObserver((mutations) => {\n if (mutations.length === 0) {\n return\n }\n\n // Check all mutations and all added nodes\n for (const mutation of mutations) {\n if (mutation.addedNodes.length === 0) continue\n\n for (const addedNode of mutation.addedNodes) {\n if (addedNode.nodeType !== Node.ELEMENT_NODE) continue\n\n const mutationNode = addedNode\n\n let portalNode = null\n if (\n // app router: body > script[data-nextjs-dev-overlay] > nextjs-portal\n mutationNode.tagName === 'SCRIPT' &&\n mutationNode.getAttribute('data-nextjs-dev-overlay')\n ) {\n portalNode = mutationNode.firstChild\n } else if (\n // pages router: body > nextjs-portal\n mutationNode.tagName === 'NEXTJS-PORTAL'\n ) {\n portalNode = mutationNode\n }\n\n if (portalNode) {\n // Wait until shadow root is available\n const checkShadowRoot = () => {\n if (getShadowRoot()) {\n flushCachedElements()\n observer.disconnect()\n cache.isObserving = false\n } else {\n // Try again after a short delay\n setTimeout(checkShadowRoot, 20)\n }\n }\n checkShadowRoot()\n return // Exit early once we find a portal\n }\n }\n }\n })\n\n observer.observe(document.body, {\n childList: true,\n subtree: true,\n })\n}\n\n/**\n * @param {HTMLElement} element\n */\nfunction insertAtTop(element) {\n // Add special recognizable data prop to element\n element.setAttribute('data-nextjs-dev-tool-style', 'true')\n\n const shadowRoot = getShadowRoot()\n if (shadowRoot) {\n // Shadow root is available, insert directly\n insertElementIntoShadowRoot(element, shadowRoot)\n } else {\n // Shadow root not available, cache the element\n const cache = window._nextjsDevtoolsStyleCache\n cache.pendingElements.push(element)\n\n // Start observing for the portal if not already observing\n startObservingForPortal()\n }\n}\n\nmodule.exports = insertAtTop\n"],"names":["window","_nextjsDevtoolsStyleCache","pendingElements","isObserving","lastInsertedElement","cachedShadowRoot","getShadowRoot","cache","portal","document","querySelector","shadowRoot","insertElementIntoShadowRoot","element","insertBefore","firstChild","nextSibling","appendChild","flushCachedElements","forEach","startObservingForPortal","observer","MutationObserver","mutations","length","mutation","addedNodes","addedNode","nodeType","Node","ELEMENT_NODE","mutationNode","portalNode","tagName","getAttribute","checkShadowRoot","disconnect","setTimeout","observe","body","childList","subtree","insertAtTop","setAttribute","push","module","exports"],"mappings":"AAAA,aAAa,GACb;;;CAGC,GAED,oEAAoE;;AACpE,IAAI,OAAOA,WAAW,aAAa;IACjCA,OAAOC,yBAAyB,GAAGD,OAAOC,yBAAyB,IAAI;QACrEC,iBAAiB,EAAE;QACnBC,aAAa;QACbC,qBAAqB;QACrBC,kBAAkB;IACpB;AACF;AAEA;;CAEC,GACD,SAASC;IACP,MAAMC,QAAQP,OAAOC,yBAAyB;IAE9C,yCAAyC;IACzC,IAAIM,MAAMF,gBAAgB,EAAE;QAC1B,OAAOE,MAAMF,gBAAgB;IAC/B;IAEA,8CAA8C;IAC9C,MAAMG,SAASC,SAASC,aAAa,CAAC;IACtC,MAAMC,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E9C,MAAMC,eAAeJ;gBAErB,IAAIK,aAAa;gBACjB,IACE,qEAAqE;gBACrED,aAAaE,OAAO,KAAK,YACzBF,aAAaG,YAAY,CAAC,4BAC1B;oBACAF,aAAaD,aAAahB,UAAU;gBACtC,OAAO,IACL,qCAAqC;gBACrCgB,aAAaE,OAAO,KAAK,iBACzB;oBACAD,aAAaD;gBACf;gBAEA,IAAIC,YAAY;oBACd,sCAAsC;oBACtC,MAAMG,kBAAkB;wBACtB,IAAI7B,iBAAiB;4BACnBY;4BACAG,SAASe,UAAU;4BACnB7B,MAAMJ,WAAW,GAAG;wBACtB,OAAO;4BACL,gCAAgC;4BAChCkC,WAAWF,iBAAiB;wBAC9B;oBACF;oBACAA;oBACA,QAAO,mCAAmC;gBAC5C;YACF;QACF;IACF;IAEAd,SAASiB,OAAO,CAAC7B,SAAS8B,IAAI,EAAE;QAC9BC,WAAW;QACXC,SAAS;IACX;AACF;AAEA;;CAEC,GACD,SAASC,YAAY7B,OAAO;IAC1B,gDAAgD;IAChDA,QAAQ8B,YAAY,CAAC,8BAA8B;IAEnD,MAAMhC,aAAaL;IACnB,IAAIK,YAAY;QACd,4CAA4C;QAC5CC,4BAA4BC,SAASF;IACvC,OAAO;QACL,+CAA+C;QAC/C,MAAMJ,QAAQP,OAAOC,yBAAyB;QAC9CM,MAAML,eAAe,CAAC0C,IAAI,CAAC/B;QAE3B,0DAA0D;QAC1DO;IACF;AACF;AAEAyB,OAAOC,OAAO,GAAGJ","ignoreList":[0]}
|
@@ -1711,7 +1711,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
1711
1711
|
isClient && new _copyfileplugin.CopyFilePlugin({
|
1712
1712
|
// file path to build output of `@next/polyfill-nomodule`
|
1713
1713
|
filePath: require.resolve('./polyfills/polyfill-nomodule'),
|
1714
|
-
cacheKey: "15.6.0-canary.
|
1714
|
+
cacheKey: "15.6.0-canary.4",
|
1715
1715
|
name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
|
1716
1716
|
minimize: false,
|
1717
1717
|
info: {
|
@@ -1895,7 +1895,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
1895
1895
|
// - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
|
1896
1896
|
// - Next.js version
|
1897
1897
|
// - next.config.js keys that affect compilation
|
1898
|
-
version: `${__dirname}|${"15.6.0-canary.
|
1898
|
+
version: `${__dirname}|${"15.6.0-canary.4"}|${configVars}`,
|
1899
1899
|
cacheDirectory: _path.default.join(distDir, 'cache', 'webpack'),
|
1900
1900
|
// For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
|
1901
1901
|
// So we disable compression here and allow the build runner to take care of compressing the cache as a whole.
|
@@ -15,7 +15,7 @@ Object.defineProperty(exports, "appBootstrap", {
|
|
15
15
|
});
|
16
16
|
const _assetprefix = require("./asset-prefix");
|
17
17
|
const _setattributesfromprops = require("./set-attributes-from-props");
|
18
|
-
const version = "15.6.0-canary.
|
18
|
+
const version = "15.6.0-canary.4";
|
19
19
|
window.next = {
|
20
20
|
version,
|
21
21
|
appDir: true
|
package/dist/client/index.js
CHANGED
@@ -61,7 +61,7 @@ const _hooksclientcontextsharedruntime = require("../shared/lib/hooks-client-con
|
|
61
61
|
const _onrecoverableerror = require("./react-client-callbacks/on-recoverable-error");
|
62
62
|
const _tracer = /*#__PURE__*/ _interop_require_default._(require("./tracing/tracer"));
|
63
63
|
const _isnextroutererror = require("./components/is-next-router-error");
|
64
|
-
const version = "15.6.0-canary.
|
64
|
+
const version = "15.6.0-canary.4";
|
65
65
|
let router;
|
66
66
|
const emitter = (0, _mitt.default)();
|
67
67
|
const looseToArray = (input)=>[].slice.call(input);
|