next 15.6.0-canary.3 → 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 +3 -3
- package/dist/build/swc/index.js +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-server/pages-api-turbo.runtime.prod.js +1 -1
- package/dist/compiled/next-server/pages-api-turbo.runtime.prod.js.map +1 -1
- package/dist/compiled/next-server/pages-turbo.runtime.prod.js +1 -1
- package/dist/compiled/next-server/pages-turbo.runtime.prod.js.map +1 -1
- package/dist/compiled/next-server/server.runtime.prod.js +1 -1
- 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 +3 -3
- package/dist/esm/build/swc/index.js +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/start-server.js +1 -1
- package/dist/esm/server/node-environment-extensions/unhandled-rejection.js +2 -2
- 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/start-server.js +1 -1
- package/dist/server/node-environment-extensions/unhandled-rejection.js +2 -2
- 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
@@ -352,7 +352,7 @@ export async function handleBuildComplete({ dir, config, distDir, pageKeys, trac
|
|
352
352
|
outputs.prerenders.push(initialOutput);
|
353
353
|
if (dataRoute) {
|
354
354
|
var _initialOutput_fallback;
|
355
|
-
let dataFilePath = path.join(pagesDistDir, `${route}.json`);
|
355
|
+
let dataFilePath = path.join(pagesDistDir, `${route === '/' ? 'index' : route}.json`);
|
356
356
|
if (isAppPage) {
|
357
357
|
// When experimental PPR is enabled, we expect that the data
|
358
358
|
// that should be served as a part of the prerender should
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/build/adapter/build-complete.ts"],"sourcesContent":["import path from 'path'\nimport fs from 'fs/promises'\nimport { pathToFileURL } from 'url'\nimport * as Log from '../output/log'\nimport { isMiddlewareFilename } from '../utils'\nimport { RenderingMode } from '../rendering-mode'\nimport { interopDefault } from '../../lib/interop-default'\nimport type { RouteHas } from '../../lib/load-custom-routes'\nimport { recursiveReadDir } from '../../lib/recursive-readdir'\nimport { isDynamicRoute } from '../../shared/lib/router/utils'\nimport type { Revalidate } from '../../server/lib/cache-control'\nimport type { NextConfigComplete } from '../../server/config-shared'\nimport type { MiddlewareMatcher } from '../analysis/get-page-static-info'\nimport { normalizeAppPath } from '../../shared/lib/router/utils/app-paths'\nimport { AdapterOutputType, type PHASE_TYPE } from '../../shared/lib/constants'\nimport { normalizePagePath } from '../../shared/lib/page-path/normalize-page-path'\n\nimport type {\n MiddlewareManifest,\n EdgeFunctionDefinition,\n} from '../webpack/plugins/middleware-plugin'\n\nimport type {\n ManifestRoute,\n RoutesManifest,\n PrerenderManifest,\n ManifestHeaderRoute,\n ManifestRewriteRoute,\n ManifestRedirectRoute,\n FunctionsConfigManifest,\n} from '..'\n\nimport {\n HTML_CONTENT_TYPE_HEADER,\n JSON_CONTENT_TYPE_HEADER,\n NEXT_RESUME_HEADER,\n} from '../../lib/constants'\n\ninterface SharedRouteFields {\n /**\n * id is the unique identifier of the output\n */\n id: string\n /**\n * filePath is the location on disk of the built entrypoint asset\n */\n filePath: string\n /**\n * pathname is the URL pathname the asset should be served at\n */\n pathname: string\n /**\n * runtime is which runtime the entrypoint is built for\n */\n runtime: 'nodejs' | 'edge'\n /**\n * assets are all necessary traced assets that could be\n * loaded by the output to handle a request e.g. traced\n * node_modules or necessary manifests for Next.js.\n * The key is the relative path from the repo root and the value\n * is the absolute path to the file\n */\n assets: Record<string, string>\n\n /**\n * config related to the route\n */\n config: {\n /**\n * maxDuration is a segment config to signal the max\n * execution duration a route should be allowed before\n * it's timed out\n */\n maxDuration?: number\n /**\n * preferredRegion is a segment config to signal deployment\n * region preferences to the provider being used\n */\n preferredRegion?: string | string[]\n }\n}\n\nexport interface AdapterOutput {\n /**\n * `PAGES` represents all the React pages that are under `pages/`.\n */\n PAGES: SharedRouteFields & {\n type: AdapterOutputType.PAGES\n }\n\n /**\n * `PAGES_API` represents all the API routes under `pages/api/`.\n */\n PAGES_API: SharedRouteFields & {\n type: AdapterOutputType.PAGES_API\n }\n /**\n * `APP_PAGE` represents all the React pages that are under `app/` with the\n * filename of `page.{j,t}s{,x}`.\n */\n APP_PAGE: SharedRouteFields & {\n type: AdapterOutputType.APP_PAGE\n }\n\n /**\n * `APP_ROUTE` represents all the API routes and metadata routes that are under `app/` with the\n * filename of `route.{j,t}s{,x}`.\n */\n APP_ROUTE: SharedRouteFields & {\n type: AdapterOutputType.APP_ROUTE\n }\n\n /**\n * `PRERENDER` represents an ISR enabled route that might\n * have a seeded cache entry or fallback generated during build\n */\n PRERENDER: {\n id: string\n pathname: string\n type: AdapterOutputType.PRERENDER\n\n /**\n * For prerenders the parent output is the originating\n * page that the prerender is created from\n */\n parentOutputId: string\n\n /**\n * groupId is the identifier for a group of prerenders that should be\n * revalidated together\n */\n groupId: number\n\n pprChain?: {\n headers: Record<string, string>\n }\n\n /**\n * fallback is initial cache data generated during build for a prerender\n */\n fallback?: {\n /**\n * path to the fallback file can be HTML/JSON/RSC\n */\n filePath: string\n /**\n * initialStatus is the status code that should be applied\n * when serving the fallback\n */\n initialStatus?: number\n /**\n * initialHeaders are the headers that should be sent when\n * serving the fallback\n */\n initialHeaders?: Record<string, string | string[]>\n /**\n * initial expiration is how long until the fallback entry\n * is considered expired and no longer valid to serve\n */\n initialExpiration?: number\n /**\n * initial revalidate is how long until the fallback is\n * considered stale and should be revalidated\n */\n initialRevalidate?: Revalidate\n\n /**\n * postponedState is the PPR state when it postponed and is used for resuming\n */\n postponedState?: string\n }\n /**\n * config related to the route\n */\n config: {\n /**\n * allowQuery is the allowed query values to be passed\n * to an ISR function and what should be considered for the cacheKey\n * e.g. for /blog/[slug], \"slug\" is the only allowQuery\n */\n allowQuery?: string[]\n /**\n * allowHeader is the allowed headers to be passed to an\n * ISR function to prevent accidentally poisoning the cache\n * from leaking additional information that can impact the render\n */\n allowHeader?: string[]\n /**\n * bypass for is a list of has conditions the cache\n * should be bypassed and invoked directly e.g. action header\n */\n bypassFor?: RouteHas[]\n /**\n * renderingMode signals PPR or not for a prerender\n */\n renderingMode?: RenderingMode\n\n /**\n * matchers are the configured matchers for middleware\n */\n matchers?: MiddlewareMatcher[]\n\n /**\n * bypassToken is the generated token that signals a prerender cache\n * should be bypassed\n */\n bypassToken?: string\n }\n }\n\n /**\n * `STATIC_FILE` represents a static file (ie /_next/static) or a purely\n * static HTML asset e.g. an automatically statically optimized page\n * that does not use ISR\n */\n STATIC_FILE: {\n id: string\n filePath: string\n pathname: string\n type: AdapterOutputType.STATIC_FILE\n }\n\n /**\n * `MIDDLEWARE` represents the middleware output if present\n */\n MIDDLEWARE: SharedRouteFields & {\n type: AdapterOutputType.MIDDLEWARE\n /**\n * config related to the route\n */\n config: SharedRouteFields['config'] & {\n /**\n * matchers are the configured matchers for middleware\n */\n matchers?: MiddlewareMatcher[]\n }\n }\n}\n\nexport interface AdapterOutputs {\n pages: Array<AdapterOutput['PAGES']>\n middleware?: AdapterOutput['MIDDLEWARE']\n appPages: Array<AdapterOutput['APP_PAGE']>\n pagesApi: Array<AdapterOutput['PAGES_API']>\n appRoutes: Array<AdapterOutput['APP_ROUTE']>\n prerenders: Array<AdapterOutput['PRERENDER']>\n staticFiles: Array<AdapterOutput['STATIC_FILE']>\n}\n\nexport interface NextAdapter {\n name: string\n /**\n * modifyConfig is called for any CLI command that loads the next.config\n * to only apply for specific commands the \"phase\" should be used\n * @param config\n * @param ctx\n * @returns\n */\n modifyConfig?: (\n config: NextConfigComplete,\n ctx: {\n phase: PHASE_TYPE\n }\n ) => Promise<NextConfigComplete> | NextConfigComplete\n onBuildComplete?: (ctx: {\n routes: {\n headers: Array<ManifestHeaderRoute>\n redirects: Array<ManifestRedirectRoute>\n rewrites: {\n beforeFiles: Array<ManifestRewriteRoute>\n afterFiles: Array<ManifestRewriteRoute>\n fallback: Array<ManifestRewriteRoute>\n }\n dynamicRoutes: ReadonlyArray<ManifestRoute>\n }\n outputs: AdapterOutputs\n /**\n * projectDir is the absolute directory the Next.js application is in\n */\n projectDir: string\n /**\n * repoRoot is the absolute path of the detected root of the repo\n */\n repoRoot: string\n /**\n * distDir is the absolute path to the dist directory\n */\n distDir: string\n /**\n * config is the loaded next.config (has modifyConfig applied)\n */\n config: NextConfigComplete\n /**\n * nextVersion is the current version of Next.js being used\n */\n nextVersion: string\n }) => Promise<void> | void\n}\n\nexport async function handleBuildComplete({\n dir,\n config,\n distDir,\n pageKeys,\n tracingRoot,\n adapterPath,\n appPageKeys,\n staticPages,\n nextVersion,\n hasStatic404,\n routesManifest,\n hasNodeMiddleware,\n prerenderManifest,\n middlewareManifest,\n requiredServerFiles,\n hasInstrumentationHook,\n functionsConfigManifest,\n}: {\n dir: string\n distDir: string\n adapterPath: string\n tracingRoot: string\n nextVersion: string\n hasStatic404: boolean\n staticPages: Set<string>\n hasNodeMiddleware: boolean\n config: NextConfigComplete\n pageKeys: readonly string[]\n requiredServerFiles: string[]\n routesManifest: RoutesManifest\n hasInstrumentationHook: boolean\n prerenderManifest: PrerenderManifest\n middlewareManifest: MiddlewareManifest\n appPageKeys?: readonly string[] | undefined\n functionsConfigManifest: FunctionsConfigManifest\n}) {\n const adapterMod = interopDefault(\n await import(pathToFileURL(require.resolve(adapterPath)).href)\n ) as NextAdapter\n\n if (typeof adapterMod.onBuildComplete === 'function') {\n Log.info(`Running onBuildComplete from ${adapterMod.name}`)\n\n try {\n const outputs: AdapterOutputs = {\n pages: [],\n pagesApi: [],\n appPages: [],\n appRoutes: [],\n prerenders: [],\n staticFiles: [],\n }\n\n const staticFiles = await recursiveReadDir(path.join(distDir, 'static'))\n\n for (const file of staticFiles) {\n const pathname = path.posix.join('/_next/static', file)\n const filePath = path.join(distDir, 'static', file)\n outputs.staticFiles.push({\n type: AdapterOutputType.STATIC_FILE,\n id: path.join('static', file),\n pathname,\n filePath,\n })\n }\n\n const sharedNodeAssets: Record<string, string> = {}\n\n for (const file of requiredServerFiles) {\n // add to shared node assets\n const filePath = path.join(dir, file)\n const fileOutputPath = path.relative(tracingRoot, filePath)\n sharedNodeAssets[fileOutputPath] = filePath\n }\n\n if (hasInstrumentationHook) {\n const assets = await handleTraceFiles(\n path.join(distDir, 'server', 'instrumentation.js.nft.json')\n )\n const fileOutputPath = path.relative(\n tracingRoot,\n path.join(distDir, 'server', 'instrumentation.js')\n )\n sharedNodeAssets[fileOutputPath] = path.join(\n distDir,\n 'server',\n 'instrumentation.js'\n )\n Object.assign(sharedNodeAssets, assets)\n }\n\n async function handleTraceFiles(\n traceFilePath: string\n ): Promise<Record<string, string>> {\n const assets: Record<string, string> = Object.assign(\n {},\n sharedNodeAssets\n )\n const traceData = JSON.parse(\n await fs.readFile(traceFilePath, 'utf8')\n ) as {\n files: string[]\n }\n const traceFileDir = path.dirname(traceFilePath)\n\n for (const relativeFile of traceData.files) {\n const tracedFilePath = path.join(traceFileDir, relativeFile)\n const fileOutputPath = path.relative(tracingRoot, tracedFilePath)\n assets[fileOutputPath] = tracedFilePath\n }\n return assets\n }\n\n async function handleEdgeFunction(\n page: EdgeFunctionDefinition,\n isMiddleware: boolean = false\n ) {\n let type: AdapterOutputType = AdapterOutputType.PAGES\n const isAppPrefix = page.page.startsWith('app/')\n const isAppPage = isAppPrefix && page.page.endsWith('/page')\n const isAppRoute = isAppPrefix && page.page.endsWith('/route')\n let currentOutputs: Array<\n | AdapterOutput['PAGES']\n | AdapterOutput['PAGES_API']\n | AdapterOutput['APP_PAGE']\n | AdapterOutput['APP_ROUTE']\n > = outputs.pages\n\n if (isMiddleware) {\n type = AdapterOutputType.MIDDLEWARE\n } else if (isAppPage) {\n currentOutputs = outputs.appPages\n type = AdapterOutputType.APP_PAGE\n } else if (isAppRoute) {\n currentOutputs = outputs.appRoutes\n type = AdapterOutputType.APP_ROUTE\n } else if (page.page.startsWith('/api')) {\n currentOutputs = outputs.pagesApi\n type = AdapterOutputType.PAGES_API\n }\n\n const output: Omit<AdapterOutput[typeof type], 'type'> & {\n type: any\n } = {\n type,\n id: page.name,\n runtime: 'edge',\n pathname: isAppPrefix ? normalizeAppPath(page.name) : page.name,\n filePath: path.join(\n distDir,\n page.files.find(\n (item) =>\n item.startsWith('server/app') || item.startsWith('server/pages')\n ) ||\n // TODO: turbopack build doesn't name the main entry chunk\n // identifiably so we don't know which to mark here but\n // technically edge needs all chunks to load always so\n // should this field even be provided?\n page.files[0] ||\n ''\n ),\n assets: {},\n config:\n type === AdapterOutputType.MIDDLEWARE\n ? {\n matchers: page.matchers,\n }\n : {},\n }\n\n function handleFile(file: string) {\n const originalPath = path.join(distDir, file)\n const fileOutputPath = path.join(\n path.relative(tracingRoot, distDir),\n file\n )\n if (!output.assets) {\n output.assets = {}\n }\n output.assets[fileOutputPath] = originalPath\n }\n for (const file of page.files) {\n handleFile(file)\n }\n for (const item of [...(page.wasm || []), ...(page.assets || [])]) {\n handleFile(item.filePath)\n }\n\n if (type === AdapterOutputType.MIDDLEWARE) {\n outputs.middleware = output\n } else {\n currentOutputs.push(output)\n }\n }\n\n const edgeFunctionHandlers: Promise<any>[] = []\n\n for (const middleware of Object.values(middlewareManifest.middleware)) {\n if (isMiddlewareFilename(middleware.name)) {\n edgeFunctionHandlers.push(handleEdgeFunction(middleware, true))\n }\n }\n\n for (const page of Object.values(middlewareManifest.functions)) {\n edgeFunctionHandlers.push(handleEdgeFunction(page))\n }\n const pagesDistDir = path.join(distDir, 'server', 'pages')\n const pageOutputMap: Record<\n string,\n AdapterOutput['PAGES'] | AdapterOutput['PAGES_API']\n > = {}\n\n for (const page of pageKeys) {\n if (page === '/_app' || page === '/_document') {\n continue\n }\n\n if (middlewareManifest.functions.hasOwnProperty(page)) {\n continue\n }\n\n const route = normalizePagePath(page)\n const pageFile = path.join(\n pagesDistDir,\n `${normalizePagePath(page)}.js`\n )\n\n // if it's an auto static optimized page it's just\n // a static file\n if (staticPages.has(page)) {\n outputs.staticFiles.push({\n id: page,\n pathname: route,\n type: AdapterOutputType.STATIC_FILE,\n filePath: pageFile.replace(/\\.js$/, '.html'),\n } satisfies AdapterOutput['STATIC_FILE'])\n continue\n }\n\n const pageTraceFile = `${pageFile}.nft.json`\n const assets = await handleTraceFiles(pageTraceFile).catch((err) => {\n if (err.code !== 'ENOENT' || (page !== '/404' && page !== '/500')) {\n Log.warn(`Failed to locate traced assets for ${pageFile}`, err)\n }\n return {} as Record<string, string>\n })\n const functionConfig = functionsConfigManifest.functions[route] || {}\n\n const output: AdapterOutput['PAGES'] | AdapterOutput['PAGES_API'] = {\n id: route,\n type: page.startsWith('/api')\n ? AdapterOutputType.PAGES_API\n : AdapterOutputType.PAGES,\n filePath: pageTraceFile.replace(/\\.nft\\.json$/, ''),\n pathname: route,\n assets,\n runtime: 'nodejs',\n config: {\n maxDuration: functionConfig.maxDuration,\n preferredRegion: functionConfig.regions,\n },\n }\n pageOutputMap[page] = output\n\n if (output.type === AdapterOutputType.PAGES) {\n outputs.pages.push(output)\n } else {\n outputs.pagesApi.push(output)\n }\n }\n\n if (hasNodeMiddleware) {\n const middlewareFile = path.join(distDir, 'server', 'middleware.js')\n const middlewareTrace = `${middlewareFile}.nft.json`\n const assets = await handleTraceFiles(middlewareTrace)\n const functionConfig =\n functionsConfigManifest.functions['/_middleware'] || {}\n\n outputs.middleware = {\n pathname: '/_middleware',\n id: '/_middleware',\n assets,\n type: AdapterOutputType.MIDDLEWARE,\n runtime: 'nodejs',\n filePath: middlewareFile,\n config: {\n matchers: functionConfig.matchers,\n },\n } satisfies AdapterOutput['MIDDLEWARE']\n }\n const appOutputMap: Record<\n string,\n AdapterOutput['APP_PAGE'] | AdapterOutput['APP_ROUTE']\n > = {}\n const appDistDir = path.join(distDir, 'server', 'app')\n\n if (appPageKeys) {\n for (const page of appPageKeys) {\n if (middlewareManifest.functions.hasOwnProperty(page)) {\n continue\n }\n const normalizedPage = normalizeAppPath(page)\n const pageFile = path.join(appDistDir, `${page}.js`)\n const pageTraceFile = `${pageFile}.nft.json`\n const assets = await handleTraceFiles(pageTraceFile).catch((err) => {\n Log.warn(`Failed to copy traced files for ${pageFile}`, err)\n return {} as Record<string, string>\n })\n const functionConfig =\n functionsConfigManifest.functions[normalizedPage] || {}\n\n const output: AdapterOutput['APP_PAGE'] | AdapterOutput['APP_ROUTE'] =\n {\n pathname: normalizedPage,\n id: normalizedPage,\n assets,\n type: page.endsWith('/route')\n ? AdapterOutputType.APP_ROUTE\n : AdapterOutputType.APP_PAGE,\n runtime: 'nodejs',\n filePath: pageFile,\n config: {\n maxDuration: functionConfig.maxDuration,\n preferredRegion: functionConfig.regions,\n },\n }\n appOutputMap[normalizedPage] = output\n\n if (output.type === AdapterOutputType.APP_PAGE) {\n outputs.appPages.push(output)\n } else {\n outputs.appRoutes.push(output)\n }\n }\n }\n\n const getParentOutput = (\n srcRoute: string,\n childRoute: string,\n allowMissing?: boolean\n ) => {\n const parentOutput = pageOutputMap[srcRoute] || appOutputMap[srcRoute]\n\n if (!parentOutput && !allowMissing) {\n console.error({\n appOutputs: Object.keys(appOutputMap),\n pageOutputs: Object.keys(pageOutputMap),\n })\n throw new Error(\n `Invariant: failed to find source route ${srcRoute} for prerender ${childRoute}`\n )\n }\n return parentOutput\n }\n\n const {\n prefetchSegmentDirSuffix,\n prefetchSegmentSuffix,\n varyHeader,\n didPostponeHeader,\n contentTypeHeader: rscContentTypeHeader,\n } = routesManifest.rsc\n\n const handleAppMeta = async (\n route: string,\n initialOutput: AdapterOutput['PRERENDER'],\n meta: {\n postponed?: string\n segmentPaths?: string[]\n }\n ) => {\n if (meta.postponed && initialOutput.fallback) {\n initialOutput.fallback.postponedState = meta.postponed\n }\n\n if (meta?.segmentPaths) {\n const segmentsDir = path.join(\n appDistDir,\n `${route}${prefetchSegmentDirSuffix}`\n )\n\n for (const segmentPath of meta.segmentPaths) {\n const outputSegmentPath =\n path.join(\n appDistDir,\n route + prefetchSegmentDirSuffix,\n segmentPath\n ) + prefetchSegmentSuffix\n\n const fallbackPathname = path.join(\n segmentsDir,\n segmentPath + prefetchSegmentSuffix\n )\n\n outputs.prerenders.push({\n id: outputSegmentPath,\n pathname: outputSegmentPath,\n type: AdapterOutputType.PRERENDER,\n parentOutputId: initialOutput.parentOutputId,\n groupId: initialOutput.groupId,\n\n config: {\n ...initialOutput.config,\n },\n\n fallback: {\n filePath: fallbackPathname,\n initialExpiration: initialOutput.fallback?.initialExpiration,\n initialRevalidate: initialOutput.fallback?.initialRevalidate,\n\n initialHeaders: {\n ...initialOutput.fallback?.initialHeaders,\n vary: varyHeader,\n 'content-type': rscContentTypeHeader,\n [didPostponeHeader]: '2',\n },\n },\n } satisfies AdapterOutput['PRERENDER'])\n }\n }\n }\n\n let prerenderGroupId = 1\n\n type AppRouteMeta = {\n segmentPaths?: string[]\n postponed?: string\n headers?: Record<string, string>\n status?: number\n }\n\n const getAppRouteMeta = async (\n route: string,\n isAppPage: boolean\n ): Promise<AppRouteMeta> => {\n const meta: AppRouteMeta = isAppPage\n ? JSON.parse(\n await fs\n .readFile(path.join(appDistDir, `${route}.meta`), 'utf8')\n .catch(() => '{}')\n )\n : {}\n\n if (meta.headers) {\n // normalize these for consistency\n for (const key of Object.keys(meta.headers)) {\n const keyLower = key.toLowerCase()\n if (keyLower !== key) {\n const value = meta.headers[key]\n delete meta.headers[key]\n meta.headers[keyLower] = value\n }\n }\n }\n\n return meta\n }\n\n for (const route in prerenderManifest.routes) {\n const {\n initialExpireSeconds: initialExpiration,\n initialRevalidateSeconds: initialRevalidate,\n initialHeaders,\n initialStatus,\n prefetchDataRoute,\n dataRoute,\n renderingMode,\n allowHeader,\n experimentalBypassFor,\n } = prerenderManifest.routes[route]\n\n const srcRoute = prerenderManifest.routes[route].srcRoute || route\n const isAppPage =\n Boolean(appOutputMap[srcRoute]) || srcRoute === '/_not-found'\n\n const isNotFoundTrue = prerenderManifest.notFoundRoutes.includes(route)\n\n let allowQuery: string[] | undefined\n const routeKeys = routesManifest.dynamicRoutes.find(\n (item) => item.page === srcRoute\n )?.routeKeys\n\n if (!isDynamicRoute(srcRoute)) {\n // for non-dynamic routes we use an empty array since\n // no query values bust the cache for non-dynamic prerenders\n // prerendered paths also do not pass allowQuery as they match\n // during handle: 'filesystem' so should not cache differently\n // by query values\n allowQuery = []\n } else if (routeKeys) {\n // if we have routeKeys in the routes-manifest we use those\n // for allowQuery for dynamic routes\n allowQuery = Object.values(routeKeys)\n }\n\n let filePath = path.join(\n isAppPage ? appDistDir : pagesDistDir,\n `${route === '/' ? 'index' : route}.${isAppPage && !dataRoute ? 'body' : 'html'}`\n )\n\n // we use the static 404 for notFound: true if available\n // if not we do a blocking invoke on first request\n if (isNotFoundTrue && hasStatic404) {\n filePath = path.join(pagesDistDir, '404.html')\n }\n\n const meta = await getAppRouteMeta(route, isAppPage)\n\n const initialOutput: AdapterOutput['PRERENDER'] = {\n id: route,\n type: AdapterOutputType.PRERENDER,\n pathname: route,\n parentOutputId:\n srcRoute === '/_not-found'\n ? srcRoute\n : getParentOutput(srcRoute, route).id,\n groupId: prerenderGroupId,\n\n pprChain:\n isAppPage && config.experimental.ppr\n ? {\n headers: {\n [NEXT_RESUME_HEADER]: '1',\n },\n }\n : undefined,\n\n fallback:\n !isNotFoundTrue || (isNotFoundTrue && hasStatic404)\n ? {\n filePath,\n initialStatus,\n initialHeaders: {\n ...initialHeaders,\n vary: varyHeader,\n 'content-type': HTML_CONTENT_TYPE_HEADER,\n ...meta.headers,\n },\n initialExpiration,\n initialRevalidate: initialRevalidate || 1,\n }\n : undefined,\n config: {\n allowQuery,\n allowHeader,\n renderingMode,\n bypassFor: experimentalBypassFor,\n bypassToken: prerenderManifest.preview.previewModeId,\n },\n }\n outputs.prerenders.push(initialOutput)\n\n if (dataRoute) {\n let dataFilePath = path.join(pagesDistDir, `${route}.json`)\n\n if (isAppPage) {\n // When experimental PPR is enabled, we expect that the data\n // that should be served as a part of the prerender should\n // be from the prefetch data route. If this isn't enabled\n // for ppr, the only way to get the data is from the data\n // route.\n dataFilePath = path.join(\n appDistDir,\n prefetchDataRoute &&\n renderingMode === RenderingMode.PARTIALLY_STATIC\n ? prefetchDataRoute\n : dataRoute\n )\n }\n\n outputs.prerenders.push({\n ...initialOutput,\n id: dataRoute,\n pathname: dataRoute,\n fallback: isNotFoundTrue\n ? undefined\n : {\n ...initialOutput.fallback,\n initialHeaders: {\n ...initialOutput.fallback?.initialHeaders,\n 'content-type': isAppPage\n ? rscContentTypeHeader\n : JSON_CONTENT_TYPE_HEADER,\n },\n filePath: dataFilePath,\n },\n })\n }\n\n if (isAppPage) {\n await handleAppMeta(route, initialOutput, meta)\n }\n prerenderGroupId += 1\n }\n\n for (const dynamicRoute in prerenderManifest.dynamicRoutes) {\n const {\n fallback,\n fallbackExpire,\n fallbackRevalidate,\n fallbackHeaders,\n fallbackStatus,\n allowHeader,\n dataRoute,\n renderingMode,\n experimentalBypassFor,\n } = prerenderManifest.dynamicRoutes[dynamicRoute]\n\n const isAppPage = Boolean(appOutputMap[dynamicRoute])\n\n const allowQuery = Object.values(\n routesManifest.dynamicRoutes.find(\n (item) => item.page === dynamicRoute\n )?.routeKeys || {}\n )\n const meta = await getAppRouteMeta(dynamicRoute, isAppPage)\n\n const initialOutput: AdapterOutput['PRERENDER'] = {\n id: dynamicRoute,\n type: AdapterOutputType.PRERENDER,\n pathname: dynamicRoute,\n parentOutputId: getParentOutput(dynamicRoute, dynamicRoute).id,\n groupId: prerenderGroupId,\n config: {\n allowQuery,\n allowHeader,\n renderingMode,\n bypassFor: experimentalBypassFor,\n bypassToken: prerenderManifest.preview.previewModeId,\n },\n fallback:\n typeof fallback === 'string'\n ? {\n filePath: path.join(\n isAppPage ? appDistDir : pagesDistDir,\n // app router dynamic route fallbacks don't have the\n // extension so ensure it's added here\n fallback.endsWith('.html') ? fallback : `${fallback}.html`\n ),\n initialStatus: fallbackStatus,\n initialHeaders: {\n ...fallbackHeaders,\n 'content-type': HTML_CONTENT_TYPE_HEADER,\n },\n initialExpiration: fallbackExpire,\n initialRevalidate: fallbackRevalidate || 1,\n }\n : undefined,\n }\n outputs.prerenders.push(initialOutput)\n\n if (isAppPage) {\n await handleAppMeta(dynamicRoute, initialOutput, meta)\n }\n\n if (dataRoute) {\n outputs.prerenders.push({\n ...initialOutput,\n id: dataRoute,\n pathname: dataRoute,\n fallback: undefined,\n })\n }\n prerenderGroupId += 1\n }\n\n await adapterMod.onBuildComplete({\n routes: {\n dynamicRoutes: routesManifest.dynamicRoutes,\n rewrites: routesManifest.rewrites,\n redirects: routesManifest.redirects,\n headers: routesManifest.headers,\n },\n outputs,\n\n config,\n distDir,\n nextVersion,\n projectDir: dir,\n repoRoot: tracingRoot,\n })\n } catch (err) {\n Log.error(`Failed to run onBuildComplete from ${adapterMod.name}`)\n throw err\n }\n }\n}\n"],"names":["path","fs","pathToFileURL","Log","isMiddlewareFilename","RenderingMode","interopDefault","recursiveReadDir","isDynamicRoute","normalizeAppPath","AdapterOutputType","normalizePagePath","HTML_CONTENT_TYPE_HEADER","JSON_CONTENT_TYPE_HEADER","NEXT_RESUME_HEADER","handleBuildComplete","dir","config","distDir","pageKeys","tracingRoot","adapterPath","appPageKeys","staticPages","nextVersion","hasStatic404","routesManifest","hasNodeMiddleware","prerenderManifest","middlewareManifest","requiredServerFiles","hasInstrumentationHook","functionsConfigManifest","adapterMod","require","resolve","href","onBuildComplete","info","name","outputs","pages","pagesApi","appPages","appRoutes","prerenders","staticFiles","join","file","pathname","posix","filePath","push","type","STATIC_FILE","id","sharedNodeAssets","fileOutputPath","relative","assets","handleTraceFiles","Object","assign","traceFilePath","traceData","JSON","parse","readFile","traceFileDir","dirname","relativeFile","files","tracedFilePath","handleEdgeFunction","page","isMiddleware","PAGES","isAppPrefix","startsWith","isAppPage","endsWith","isAppRoute","currentOutputs","MIDDLEWARE","APP_PAGE","APP_ROUTE","PAGES_API","output","runtime","find","item","matchers","handleFile","originalPath","wasm","middleware","edgeFunctionHandlers","values","functions","pagesDistDir","pageOutputMap","hasOwnProperty","route","pageFile","has","replace","pageTraceFile","catch","err","code","warn","functionConfig","maxDuration","preferredRegion","regions","middlewareFile","middlewareTrace","appOutputMap","appDistDir","normalizedPage","getParentOutput","srcRoute","childRoute","allowMissing","parentOutput","console","error","appOutputs","keys","pageOutputs","Error","prefetchSegmentDirSuffix","prefetchSegmentSuffix","varyHeader","didPostponeHeader","contentTypeHeader","rscContentTypeHeader","rsc","handleAppMeta","initialOutput","meta","postponed","fallback","postponedState","segmentPaths","segmentsDir","segmentPath","outputSegmentPath","fallbackPathname","PRERENDER","parentOutputId","groupId","initialExpiration","initialRevalidate","initialHeaders","vary","prerenderGroupId","getAppRouteMeta","headers","key","keyLower","toLowerCase","value","routes","initialExpireSeconds","initialRevalidateSeconds","initialStatus","prefetchDataRoute","dataRoute","renderingMode","allowHeader","experimentalBypassFor","Boolean","isNotFoundTrue","notFoundRoutes","includes","allowQuery","routeKeys","dynamicRoutes","pprChain","experimental","ppr","undefined","bypassFor","bypassToken","preview","previewModeId","dataFilePath","PARTIALLY_STATIC","dynamicRoute","fallbackExpire","fallbackRevalidate","fallbackHeaders","fallbackStatus","rewrites","redirects","projectDir","repoRoot"],"mappings":"AAAA,OAAOA,UAAU,OAAM;AACvB,OAAOC,QAAQ,cAAa;AAC5B,SAASC,aAAa,QAAQ,MAAK;AACnC,YAAYC,SAAS,gBAAe;AACpC,SAASC,oBAAoB,QAAQ,WAAU;AAC/C,SAASC,aAAa,QAAQ,oBAAmB;AACjD,SAASC,cAAc,QAAQ,4BAA2B;AAE1D,SAASC,gBAAgB,QAAQ,8BAA6B;AAC9D,SAASC,cAAc,QAAQ,gCAA+B;AAI9D,SAASC,gBAAgB,QAAQ,0CAAyC;AAC1E,SAASC,iBAAiB,QAAyB,6BAA4B;AAC/E,SAASC,iBAAiB,QAAQ,iDAAgD;AAiBlF,SACEC,wBAAwB,EACxBC,wBAAwB,EACxBC,kBAAkB,QACb,sBAAqB;AAuQ5B,OAAO,eAAeC,oBAAoB,EACxCC,GAAG,EACHC,MAAM,EACNC,OAAO,EACPC,QAAQ,EACRC,WAAW,EACXC,WAAW,EACXC,WAAW,EACXC,WAAW,EACXC,WAAW,EACXC,YAAY,EACZC,cAAc,EACdC,iBAAiB,EACjBC,iBAAiB,EACjBC,kBAAkB,EAClBC,mBAAmB,EACnBC,sBAAsB,EACtBC,uBAAuB,EAmBxB;IACC,MAAMC,aAAa3B,eACjB,MAAM,MAAM,CAACJ,cAAcgC,QAAQC,OAAO,CAACd,cAAce,IAAI;IAG/D,IAAI,OAAOH,WAAWI,eAAe,KAAK,YAAY;QACpDlC,IAAImC,IAAI,CAAC,CAAC,6BAA6B,EAAEL,WAAWM,IAAI,EAAE;QAE1D,IAAI;YACF,MAAMC,UAA0B;gBAC9BC,OAAO,EAAE;gBACTC,UAAU,EAAE;gBACZC,UAAU,EAAE;gBACZC,WAAW,EAAE;gBACbC,YAAY,EAAE;gBACdC,aAAa,EAAE;YACjB;YAEA,MAAMA,cAAc,MAAMvC,iBAAiB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BAClB,gBAAgBpL;wBAClB;wBACA4I,mBAAmBsC;wBACnBrC,mBAAmBsC,sBAAsB;oBAC3C,IACAT;gBACR;gBACA9I,QAAQK,UAAU,CAACO,IAAI,CAACuF;gBAExB,IAAI5D,WAAW;oBACb,MAAM2D,cAAcmD,cAAclD,eAAeC;gBACnD;gBAEA,IAAI4B,WAAW;oBACbhI,QAAQK,UAAU,CAACO,IAAI,CAAC;wBACtB,GAAGuF,aAAa;wBAChBpF,IAAIiH;wBACJvH,UAAUuH;wBACV1B,UAAUwC;oBACZ;gBACF;gBACA1B,oBAAoB;YACtB;YAEA,MAAM3H,WAAWI,eAAe,CAAC;gBAC/B8H,QAAQ;oBACNe,eAAexJ,eAAewJ,aAAa;oBAC3CgB,UAAUxK,eAAewK,QAAQ;oBACjCC,WAAWzK,eAAeyK,SAAS;oBACnCrC,SAASpI,eAAeoI,OAAO;gBACjC;gBACAtH;gBAEAvB;gBACAC;gBACAM;gBACA4K,YAAYpL;gBACZqL,UAAUjL;YACZ;QACF,EAAE,OAAOwF,KAAK;YACZzG,IAAI2H,KAAK,CAAC,CAAC,mCAAmC,EAAE7F,WAAWM,IAAI,EAAE;YACjE,MAAMqE;QACR;IACF;AACF","ignoreList":[0]}
|
1
|
+
{"version":3,"sources":["../../../src/build/adapter/build-complete.ts"],"sourcesContent":["import path from 'path'\nimport fs from 'fs/promises'\nimport { pathToFileURL } from 'url'\nimport * as Log from '../output/log'\nimport { isMiddlewareFilename } from '../utils'\nimport { RenderingMode } from '../rendering-mode'\nimport { interopDefault } from '../../lib/interop-default'\nimport type { RouteHas } from '../../lib/load-custom-routes'\nimport { recursiveReadDir } from '../../lib/recursive-readdir'\nimport { isDynamicRoute } from '../../shared/lib/router/utils'\nimport type { Revalidate } from '../../server/lib/cache-control'\nimport type { NextConfigComplete } from '../../server/config-shared'\nimport type { MiddlewareMatcher } from '../analysis/get-page-static-info'\nimport { normalizeAppPath } from '../../shared/lib/router/utils/app-paths'\nimport { AdapterOutputType, type PHASE_TYPE } from '../../shared/lib/constants'\nimport { normalizePagePath } from '../../shared/lib/page-path/normalize-page-path'\n\nimport type {\n MiddlewareManifest,\n EdgeFunctionDefinition,\n} from '../webpack/plugins/middleware-plugin'\n\nimport type {\n ManifestRoute,\n RoutesManifest,\n PrerenderManifest,\n ManifestHeaderRoute,\n ManifestRewriteRoute,\n ManifestRedirectRoute,\n FunctionsConfigManifest,\n} from '..'\n\nimport {\n HTML_CONTENT_TYPE_HEADER,\n JSON_CONTENT_TYPE_HEADER,\n NEXT_RESUME_HEADER,\n} from '../../lib/constants'\n\ninterface SharedRouteFields {\n /**\n * id is the unique identifier of the output\n */\n id: string\n /**\n * filePath is the location on disk of the built entrypoint asset\n */\n filePath: string\n /**\n * pathname is the URL pathname the asset should be served at\n */\n pathname: string\n /**\n * runtime is which runtime the entrypoint is built for\n */\n runtime: 'nodejs' | 'edge'\n /**\n * assets are all necessary traced assets that could be\n * loaded by the output to handle a request e.g. traced\n * node_modules or necessary manifests for Next.js.\n * The key is the relative path from the repo root and the value\n * is the absolute path to the file\n */\n assets: Record<string, string>\n\n /**\n * config related to the route\n */\n config: {\n /**\n * maxDuration is a segment config to signal the max\n * execution duration a route should be allowed before\n * it's timed out\n */\n maxDuration?: number\n /**\n * preferredRegion is a segment config to signal deployment\n * region preferences to the provider being used\n */\n preferredRegion?: string | string[]\n }\n}\n\nexport interface AdapterOutput {\n /**\n * `PAGES` represents all the React pages that are under `pages/`.\n */\n PAGES: SharedRouteFields & {\n type: AdapterOutputType.PAGES\n }\n\n /**\n * `PAGES_API` represents all the API routes under `pages/api/`.\n */\n PAGES_API: SharedRouteFields & {\n type: AdapterOutputType.PAGES_API\n }\n /**\n * `APP_PAGE` represents all the React pages that are under `app/` with the\n * filename of `page.{j,t}s{,x}`.\n */\n APP_PAGE: SharedRouteFields & {\n type: AdapterOutputType.APP_PAGE\n }\n\n /**\n * `APP_ROUTE` represents all the API routes and metadata routes that are under `app/` with the\n * filename of `route.{j,t}s{,x}`.\n */\n APP_ROUTE: SharedRouteFields & {\n type: AdapterOutputType.APP_ROUTE\n }\n\n /**\n * `PRERENDER` represents an ISR enabled route that might\n * have a seeded cache entry or fallback generated during build\n */\n PRERENDER: {\n id: string\n pathname: string\n type: AdapterOutputType.PRERENDER\n\n /**\n * For prerenders the parent output is the originating\n * page that the prerender is created from\n */\n parentOutputId: string\n\n /**\n * groupId is the identifier for a group of prerenders that should be\n * revalidated together\n */\n groupId: number\n\n pprChain?: {\n headers: Record<string, string>\n }\n\n /**\n * fallback is initial cache data generated during build for a prerender\n */\n fallback?: {\n /**\n * path to the fallback file can be HTML/JSON/RSC\n */\n filePath: string\n /**\n * initialStatus is the status code that should be applied\n * when serving the fallback\n */\n initialStatus?: number\n /**\n * initialHeaders are the headers that should be sent when\n * serving the fallback\n */\n initialHeaders?: Record<string, string | string[]>\n /**\n * initial expiration is how long until the fallback entry\n * is considered expired and no longer valid to serve\n */\n initialExpiration?: number\n /**\n * initial revalidate is how long until the fallback is\n * considered stale and should be revalidated\n */\n initialRevalidate?: Revalidate\n\n /**\n * postponedState is the PPR state when it postponed and is used for resuming\n */\n postponedState?: string\n }\n /**\n * config related to the route\n */\n config: {\n /**\n * allowQuery is the allowed query values to be passed\n * to an ISR function and what should be considered for the cacheKey\n * e.g. for /blog/[slug], \"slug\" is the only allowQuery\n */\n allowQuery?: string[]\n /**\n * allowHeader is the allowed headers to be passed to an\n * ISR function to prevent accidentally poisoning the cache\n * from leaking additional information that can impact the render\n */\n allowHeader?: string[]\n /**\n * bypass for is a list of has conditions the cache\n * should be bypassed and invoked directly e.g. action header\n */\n bypassFor?: RouteHas[]\n /**\n * renderingMode signals PPR or not for a prerender\n */\n renderingMode?: RenderingMode\n\n /**\n * matchers are the configured matchers for middleware\n */\n matchers?: MiddlewareMatcher[]\n\n /**\n * bypassToken is the generated token that signals a prerender cache\n * should be bypassed\n */\n bypassToken?: string\n }\n }\n\n /**\n * `STATIC_FILE` represents a static file (ie /_next/static) or a purely\n * static HTML asset e.g. an automatically statically optimized page\n * that does not use ISR\n */\n STATIC_FILE: {\n id: string\n filePath: string\n pathname: string\n type: AdapterOutputType.STATIC_FILE\n }\n\n /**\n * `MIDDLEWARE` represents the middleware output if present\n */\n MIDDLEWARE: SharedRouteFields & {\n type: AdapterOutputType.MIDDLEWARE\n /**\n * config related to the route\n */\n config: SharedRouteFields['config'] & {\n /**\n * matchers are the configured matchers for middleware\n */\n matchers?: MiddlewareMatcher[]\n }\n }\n}\n\nexport interface AdapterOutputs {\n pages: Array<AdapterOutput['PAGES']>\n middleware?: AdapterOutput['MIDDLEWARE']\n appPages: Array<AdapterOutput['APP_PAGE']>\n pagesApi: Array<AdapterOutput['PAGES_API']>\n appRoutes: Array<AdapterOutput['APP_ROUTE']>\n prerenders: Array<AdapterOutput['PRERENDER']>\n staticFiles: Array<AdapterOutput['STATIC_FILE']>\n}\n\nexport interface NextAdapter {\n name: string\n /**\n * modifyConfig is called for any CLI command that loads the next.config\n * to only apply for specific commands the \"phase\" should be used\n * @param config\n * @param ctx\n * @returns\n */\n modifyConfig?: (\n config: NextConfigComplete,\n ctx: {\n phase: PHASE_TYPE\n }\n ) => Promise<NextConfigComplete> | NextConfigComplete\n onBuildComplete?: (ctx: {\n routes: {\n headers: Array<ManifestHeaderRoute>\n redirects: Array<ManifestRedirectRoute>\n rewrites: {\n beforeFiles: Array<ManifestRewriteRoute>\n afterFiles: Array<ManifestRewriteRoute>\n fallback: Array<ManifestRewriteRoute>\n }\n dynamicRoutes: ReadonlyArray<ManifestRoute>\n }\n outputs: AdapterOutputs\n /**\n * projectDir is the absolute directory the Next.js application is in\n */\n projectDir: string\n /**\n * repoRoot is the absolute path of the detected root of the repo\n */\n repoRoot: string\n /**\n * distDir is the absolute path to the dist directory\n */\n distDir: string\n /**\n * config is the loaded next.config (has modifyConfig applied)\n */\n config: NextConfigComplete\n /**\n * nextVersion is the current version of Next.js being used\n */\n nextVersion: string\n }) => Promise<void> | void\n}\n\nexport async function handleBuildComplete({\n dir,\n config,\n distDir,\n pageKeys,\n tracingRoot,\n adapterPath,\n appPageKeys,\n staticPages,\n nextVersion,\n hasStatic404,\n routesManifest,\n hasNodeMiddleware,\n prerenderManifest,\n middlewareManifest,\n requiredServerFiles,\n hasInstrumentationHook,\n functionsConfigManifest,\n}: {\n dir: string\n distDir: string\n adapterPath: string\n tracingRoot: string\n nextVersion: string\n hasStatic404: boolean\n staticPages: Set<string>\n hasNodeMiddleware: boolean\n config: NextConfigComplete\n pageKeys: readonly string[]\n requiredServerFiles: string[]\n routesManifest: RoutesManifest\n hasInstrumentationHook: boolean\n prerenderManifest: PrerenderManifest\n middlewareManifest: MiddlewareManifest\n appPageKeys?: readonly string[] | undefined\n functionsConfigManifest: FunctionsConfigManifest\n}) {\n const adapterMod = interopDefault(\n await import(pathToFileURL(require.resolve(adapterPath)).href)\n ) as NextAdapter\n\n if (typeof adapterMod.onBuildComplete === 'function') {\n Log.info(`Running onBuildComplete from ${adapterMod.name}`)\n\n try {\n const outputs: AdapterOutputs = {\n pages: [],\n pagesApi: [],\n appPages: [],\n appRoutes: [],\n prerenders: [],\n staticFiles: [],\n }\n\n const staticFiles = await recursiveReadDir(path.join(distDir, 'static'))\n\n for (const file of staticFiles) {\n const pathname = path.posix.join('/_next/static', file)\n const filePath = path.join(distDir, 'static', file)\n outputs.staticFiles.push({\n type: AdapterOutputType.STATIC_FILE,\n id: path.join('static', file),\n pathname,\n filePath,\n })\n }\n\n const sharedNodeAssets: Record<string, string> = {}\n\n for (const file of requiredServerFiles) {\n // add to shared node assets\n const filePath = path.join(dir, file)\n const fileOutputPath = path.relative(tracingRoot, filePath)\n sharedNodeAssets[fileOutputPath] = filePath\n }\n\n if (hasInstrumentationHook) {\n const assets = await handleTraceFiles(\n path.join(distDir, 'server', 'instrumentation.js.nft.json')\n )\n const fileOutputPath = path.relative(\n tracingRoot,\n path.join(distDir, 'server', 'instrumentation.js')\n )\n sharedNodeAssets[fileOutputPath] = path.join(\n distDir,\n 'server',\n 'instrumentation.js'\n )\n Object.assign(sharedNodeAssets, assets)\n }\n\n async function handleTraceFiles(\n traceFilePath: string\n ): Promise<Record<string, string>> {\n const assets: Record<string, string> = Object.assign(\n {},\n sharedNodeAssets\n )\n const traceData = JSON.parse(\n await fs.readFile(traceFilePath, 'utf8')\n ) as {\n files: string[]\n }\n const traceFileDir = path.dirname(traceFilePath)\n\n for (const relativeFile of traceData.files) {\n const tracedFilePath = path.join(traceFileDir, relativeFile)\n const fileOutputPath = path.relative(tracingRoot, tracedFilePath)\n assets[fileOutputPath] = tracedFilePath\n }\n return assets\n }\n\n async function handleEdgeFunction(\n page: EdgeFunctionDefinition,\n isMiddleware: boolean = false\n ) {\n let type: AdapterOutputType = AdapterOutputType.PAGES\n const isAppPrefix = page.page.startsWith('app/')\n const isAppPage = isAppPrefix && page.page.endsWith('/page')\n const isAppRoute = isAppPrefix && page.page.endsWith('/route')\n let currentOutputs: Array<\n | AdapterOutput['PAGES']\n | AdapterOutput['PAGES_API']\n | AdapterOutput['APP_PAGE']\n | AdapterOutput['APP_ROUTE']\n > = outputs.pages\n\n if (isMiddleware) {\n type = AdapterOutputType.MIDDLEWARE\n } else if (isAppPage) {\n currentOutputs = outputs.appPages\n type = AdapterOutputType.APP_PAGE\n } else if (isAppRoute) {\n currentOutputs = outputs.appRoutes\n type = AdapterOutputType.APP_ROUTE\n } else if (page.page.startsWith('/api')) {\n currentOutputs = outputs.pagesApi\n type = AdapterOutputType.PAGES_API\n }\n\n const output: Omit<AdapterOutput[typeof type], 'type'> & {\n type: any\n } = {\n type,\n id: page.name,\n runtime: 'edge',\n pathname: isAppPrefix ? normalizeAppPath(page.name) : page.name,\n filePath: path.join(\n distDir,\n page.files.find(\n (item) =>\n item.startsWith('server/app') || item.startsWith('server/pages')\n ) ||\n // TODO: turbopack build doesn't name the main entry chunk\n // identifiably so we don't know which to mark here but\n // technically edge needs all chunks to load always so\n // should this field even be provided?\n page.files[0] ||\n ''\n ),\n assets: {},\n config:\n type === AdapterOutputType.MIDDLEWARE\n ? {\n matchers: page.matchers,\n }\n : {},\n }\n\n function handleFile(file: string) {\n const originalPath = path.join(distDir, file)\n const fileOutputPath = path.join(\n path.relative(tracingRoot, distDir),\n file\n )\n if (!output.assets) {\n output.assets = {}\n }\n output.assets[fileOutputPath] = originalPath\n }\n for (const file of page.files) {\n handleFile(file)\n }\n for (const item of [...(page.wasm || []), ...(page.assets || [])]) {\n handleFile(item.filePath)\n }\n\n if (type === AdapterOutputType.MIDDLEWARE) {\n outputs.middleware = output\n } else {\n currentOutputs.push(output)\n }\n }\n\n const edgeFunctionHandlers: Promise<any>[] = []\n\n for (const middleware of Object.values(middlewareManifest.middleware)) {\n if (isMiddlewareFilename(middleware.name)) {\n edgeFunctionHandlers.push(handleEdgeFunction(middleware, true))\n }\n }\n\n for (const page of Object.values(middlewareManifest.functions)) {\n edgeFunctionHandlers.push(handleEdgeFunction(page))\n }\n const pagesDistDir = path.join(distDir, 'server', 'pages')\n const pageOutputMap: Record<\n string,\n AdapterOutput['PAGES'] | AdapterOutput['PAGES_API']\n > = {}\n\n for (const page of pageKeys) {\n if (page === '/_app' || page === '/_document') {\n continue\n }\n\n if (middlewareManifest.functions.hasOwnProperty(page)) {\n continue\n }\n\n const route = normalizePagePath(page)\n const pageFile = path.join(\n pagesDistDir,\n `${normalizePagePath(page)}.js`\n )\n\n // if it's an auto static optimized page it's just\n // a static file\n if (staticPages.has(page)) {\n outputs.staticFiles.push({\n id: page,\n pathname: route,\n type: AdapterOutputType.STATIC_FILE,\n filePath: pageFile.replace(/\\.js$/, '.html'),\n } satisfies AdapterOutput['STATIC_FILE'])\n continue\n }\n\n const pageTraceFile = `${pageFile}.nft.json`\n const assets = await handleTraceFiles(pageTraceFile).catch((err) => {\n if (err.code !== 'ENOENT' || (page !== '/404' && page !== '/500')) {\n Log.warn(`Failed to locate traced assets for ${pageFile}`, err)\n }\n return {} as Record<string, string>\n })\n const functionConfig = functionsConfigManifest.functions[route] || {}\n\n const output: AdapterOutput['PAGES'] | AdapterOutput['PAGES_API'] = {\n id: route,\n type: page.startsWith('/api')\n ? AdapterOutputType.PAGES_API\n : AdapterOutputType.PAGES,\n filePath: pageTraceFile.replace(/\\.nft\\.json$/, ''),\n pathname: route,\n assets,\n runtime: 'nodejs',\n config: {\n maxDuration: functionConfig.maxDuration,\n preferredRegion: functionConfig.regions,\n },\n }\n pageOutputMap[page] = output\n\n if (output.type === AdapterOutputType.PAGES) {\n outputs.pages.push(output)\n } else {\n outputs.pagesApi.push(output)\n }\n }\n\n if (hasNodeMiddleware) {\n const middlewareFile = path.join(distDir, 'server', 'middleware.js')\n const middlewareTrace = `${middlewareFile}.nft.json`\n const assets = await handleTraceFiles(middlewareTrace)\n const functionConfig =\n functionsConfigManifest.functions['/_middleware'] || {}\n\n outputs.middleware = {\n pathname: '/_middleware',\n id: '/_middleware',\n assets,\n type: AdapterOutputType.MIDDLEWARE,\n runtime: 'nodejs',\n filePath: middlewareFile,\n config: {\n matchers: functionConfig.matchers,\n },\n } satisfies AdapterOutput['MIDDLEWARE']\n }\n const appOutputMap: Record<\n string,\n AdapterOutput['APP_PAGE'] | AdapterOutput['APP_ROUTE']\n > = {}\n const appDistDir = path.join(distDir, 'server', 'app')\n\n if (appPageKeys) {\n for (const page of appPageKeys) {\n if (middlewareManifest.functions.hasOwnProperty(page)) {\n continue\n }\n const normalizedPage = normalizeAppPath(page)\n const pageFile = path.join(appDistDir, `${page}.js`)\n const pageTraceFile = `${pageFile}.nft.json`\n const assets = await handleTraceFiles(pageTraceFile).catch((err) => {\n Log.warn(`Failed to copy traced files for ${pageFile}`, err)\n return {} as Record<string, string>\n })\n const functionConfig =\n functionsConfigManifest.functions[normalizedPage] || {}\n\n const output: AdapterOutput['APP_PAGE'] | AdapterOutput['APP_ROUTE'] =\n {\n pathname: normalizedPage,\n id: normalizedPage,\n assets,\n type: page.endsWith('/route')\n ? AdapterOutputType.APP_ROUTE\n : AdapterOutputType.APP_PAGE,\n runtime: 'nodejs',\n filePath: pageFile,\n config: {\n maxDuration: functionConfig.maxDuration,\n preferredRegion: functionConfig.regions,\n },\n }\n appOutputMap[normalizedPage] = output\n\n if (output.type === AdapterOutputType.APP_PAGE) {\n outputs.appPages.push(output)\n } else {\n outputs.appRoutes.push(output)\n }\n }\n }\n\n const getParentOutput = (\n srcRoute: string,\n childRoute: string,\n allowMissing?: boolean\n ) => {\n const parentOutput = pageOutputMap[srcRoute] || appOutputMap[srcRoute]\n\n if (!parentOutput && !allowMissing) {\n console.error({\n appOutputs: Object.keys(appOutputMap),\n pageOutputs: Object.keys(pageOutputMap),\n })\n throw new Error(\n `Invariant: failed to find source route ${srcRoute} for prerender ${childRoute}`\n )\n }\n return parentOutput\n }\n\n const {\n prefetchSegmentDirSuffix,\n prefetchSegmentSuffix,\n varyHeader,\n didPostponeHeader,\n contentTypeHeader: rscContentTypeHeader,\n } = routesManifest.rsc\n\n const handleAppMeta = async (\n route: string,\n initialOutput: AdapterOutput['PRERENDER'],\n meta: {\n postponed?: string\n segmentPaths?: string[]\n }\n ) => {\n if (meta.postponed && initialOutput.fallback) {\n initialOutput.fallback.postponedState = meta.postponed\n }\n\n if (meta?.segmentPaths) {\n const segmentsDir = path.join(\n appDistDir,\n `${route}${prefetchSegmentDirSuffix}`\n )\n\n for (const segmentPath of meta.segmentPaths) {\n const outputSegmentPath =\n path.join(\n appDistDir,\n route + prefetchSegmentDirSuffix,\n segmentPath\n ) + prefetchSegmentSuffix\n\n const fallbackPathname = path.join(\n segmentsDir,\n segmentPath + prefetchSegmentSuffix\n )\n\n outputs.prerenders.push({\n id: outputSegmentPath,\n pathname: outputSegmentPath,\n type: AdapterOutputType.PRERENDER,\n parentOutputId: initialOutput.parentOutputId,\n groupId: initialOutput.groupId,\n\n config: {\n ...initialOutput.config,\n },\n\n fallback: {\n filePath: fallbackPathname,\n initialExpiration: initialOutput.fallback?.initialExpiration,\n initialRevalidate: initialOutput.fallback?.initialRevalidate,\n\n initialHeaders: {\n ...initialOutput.fallback?.initialHeaders,\n vary: varyHeader,\n 'content-type': rscContentTypeHeader,\n [didPostponeHeader]: '2',\n },\n },\n } satisfies AdapterOutput['PRERENDER'])\n }\n }\n }\n\n let prerenderGroupId = 1\n\n type AppRouteMeta = {\n segmentPaths?: string[]\n postponed?: string\n headers?: Record<string, string>\n status?: number\n }\n\n const getAppRouteMeta = async (\n route: string,\n isAppPage: boolean\n ): Promise<AppRouteMeta> => {\n const meta: AppRouteMeta = isAppPage\n ? JSON.parse(\n await fs\n .readFile(path.join(appDistDir, `${route}.meta`), 'utf8')\n .catch(() => '{}')\n )\n : {}\n\n if (meta.headers) {\n // normalize these for consistency\n for (const key of Object.keys(meta.headers)) {\n const keyLower = key.toLowerCase()\n if (keyLower !== key) {\n const value = meta.headers[key]\n delete meta.headers[key]\n meta.headers[keyLower] = value\n }\n }\n }\n\n return meta\n }\n\n for (const route in prerenderManifest.routes) {\n const {\n initialExpireSeconds: initialExpiration,\n initialRevalidateSeconds: initialRevalidate,\n initialHeaders,\n initialStatus,\n prefetchDataRoute,\n dataRoute,\n renderingMode,\n allowHeader,\n experimentalBypassFor,\n } = prerenderManifest.routes[route]\n\n const srcRoute = prerenderManifest.routes[route].srcRoute || route\n const isAppPage =\n Boolean(appOutputMap[srcRoute]) || srcRoute === '/_not-found'\n\n const isNotFoundTrue = prerenderManifest.notFoundRoutes.includes(route)\n\n let allowQuery: string[] | undefined\n const routeKeys = routesManifest.dynamicRoutes.find(\n (item) => item.page === srcRoute\n )?.routeKeys\n\n if (!isDynamicRoute(srcRoute)) {\n // for non-dynamic routes we use an empty array since\n // no query values bust the cache for non-dynamic prerenders\n // prerendered paths also do not pass allowQuery as they match\n // during handle: 'filesystem' so should not cache differently\n // by query values\n allowQuery = []\n } else if (routeKeys) {\n // if we have routeKeys in the routes-manifest we use those\n // for allowQuery for dynamic routes\n allowQuery = Object.values(routeKeys)\n }\n\n let filePath = path.join(\n isAppPage ? appDistDir : pagesDistDir,\n `${route === '/' ? 'index' : route}.${isAppPage && !dataRoute ? 'body' : 'html'}`\n )\n\n // we use the static 404 for notFound: true if available\n // if not we do a blocking invoke on first request\n if (isNotFoundTrue && hasStatic404) {\n filePath = path.join(pagesDistDir, '404.html')\n }\n\n const meta = await getAppRouteMeta(route, isAppPage)\n\n const initialOutput: AdapterOutput['PRERENDER'] = {\n id: route,\n type: AdapterOutputType.PRERENDER,\n pathname: route,\n parentOutputId:\n srcRoute === '/_not-found'\n ? srcRoute\n : getParentOutput(srcRoute, route).id,\n groupId: prerenderGroupId,\n\n pprChain:\n isAppPage && config.experimental.ppr\n ? {\n headers: {\n [NEXT_RESUME_HEADER]: '1',\n },\n }\n : undefined,\n\n fallback:\n !isNotFoundTrue || (isNotFoundTrue && hasStatic404)\n ? {\n filePath,\n initialStatus,\n initialHeaders: {\n ...initialHeaders,\n vary: varyHeader,\n 'content-type': HTML_CONTENT_TYPE_HEADER,\n ...meta.headers,\n },\n initialExpiration,\n initialRevalidate: initialRevalidate || 1,\n }\n : undefined,\n config: {\n allowQuery,\n allowHeader,\n renderingMode,\n bypassFor: experimentalBypassFor,\n bypassToken: prerenderManifest.preview.previewModeId,\n },\n }\n outputs.prerenders.push(initialOutput)\n\n if (dataRoute) {\n let dataFilePath = path.join(\n pagesDistDir,\n `${route === '/' ? 'index' : route}.json`\n )\n\n if (isAppPage) {\n // When experimental PPR is enabled, we expect that the data\n // that should be served as a part of the prerender should\n // be from the prefetch data route. If this isn't enabled\n // for ppr, the only way to get the data is from the data\n // route.\n dataFilePath = path.join(\n appDistDir,\n prefetchDataRoute &&\n renderingMode === RenderingMode.PARTIALLY_STATIC\n ? prefetchDataRoute\n : dataRoute\n )\n }\n\n outputs.prerenders.push({\n ...initialOutput,\n id: dataRoute,\n pathname: dataRoute,\n fallback: isNotFoundTrue\n ? undefined\n : {\n ...initialOutput.fallback,\n initialHeaders: {\n ...initialOutput.fallback?.initialHeaders,\n 'content-type': isAppPage\n ? rscContentTypeHeader\n : JSON_CONTENT_TYPE_HEADER,\n },\n filePath: dataFilePath,\n },\n })\n }\n\n if (isAppPage) {\n await handleAppMeta(route, initialOutput, meta)\n }\n prerenderGroupId += 1\n }\n\n for (const dynamicRoute in prerenderManifest.dynamicRoutes) {\n const {\n fallback,\n fallbackExpire,\n fallbackRevalidate,\n fallbackHeaders,\n fallbackStatus,\n allowHeader,\n dataRoute,\n renderingMode,\n experimentalBypassFor,\n } = prerenderManifest.dynamicRoutes[dynamicRoute]\n\n const isAppPage = Boolean(appOutputMap[dynamicRoute])\n\n const allowQuery = Object.values(\n routesManifest.dynamicRoutes.find(\n (item) => item.page === dynamicRoute\n )?.routeKeys || {}\n )\n const meta = await getAppRouteMeta(dynamicRoute, isAppPage)\n\n const initialOutput: AdapterOutput['PRERENDER'] = {\n id: dynamicRoute,\n type: AdapterOutputType.PRERENDER,\n pathname: dynamicRoute,\n parentOutputId: getParentOutput(dynamicRoute, dynamicRoute).id,\n groupId: prerenderGroupId,\n config: {\n allowQuery,\n allowHeader,\n renderingMode,\n bypassFor: experimentalBypassFor,\n bypassToken: prerenderManifest.preview.previewModeId,\n },\n fallback:\n typeof fallback === 'string'\n ? {\n filePath: path.join(\n isAppPage ? appDistDir : pagesDistDir,\n // app router dynamic route fallbacks don't have the\n // extension so ensure it's added here\n fallback.endsWith('.html') ? fallback : `${fallback}.html`\n ),\n initialStatus: fallbackStatus,\n initialHeaders: {\n ...fallbackHeaders,\n 'content-type': HTML_CONTENT_TYPE_HEADER,\n },\n initialExpiration: fallbackExpire,\n initialRevalidate: fallbackRevalidate || 1,\n }\n : undefined,\n }\n outputs.prerenders.push(initialOutput)\n\n if (isAppPage) {\n await handleAppMeta(dynamicRoute, initialOutput, meta)\n }\n\n if (dataRoute) {\n outputs.prerenders.push({\n ...initialOutput,\n id: dataRoute,\n pathname: dataRoute,\n fallback: undefined,\n })\n }\n prerenderGroupId += 1\n }\n\n await adapterMod.onBuildComplete({\n routes: {\n dynamicRoutes: routesManifest.dynamicRoutes,\n rewrites: routesManifest.rewrites,\n redirects: routesManifest.redirects,\n headers: routesManifest.headers,\n },\n outputs,\n\n config,\n distDir,\n nextVersion,\n projectDir: dir,\n repoRoot: tracingRoot,\n })\n } catch (err) {\n Log.error(`Failed to run onBuildComplete from ${adapterMod.name}`)\n throw err\n }\n }\n}\n"],"names":["path","fs","pathToFileURL","Log","isMiddlewareFilename","RenderingMode","interopDefault","recursiveReadDir","isDynamicRoute","normalizeAppPath","AdapterOutputType","normalizePagePath","HTML_CONTENT_TYPE_HEADER","JSON_CONTENT_TYPE_HEADER","NEXT_RESUME_HEADER","handleBuildComplete","dir","config","distDir","pageKeys","tracingRoot","adapterPath","appPageKeys","staticPages","nextVersion","hasStatic404","routesManifest","hasNodeMiddleware","prerenderManifest","middlewareManifest","requiredServerFiles","hasInstrumentationHook","functionsConfigManifest","adapterMod","require","resolve","href","onBuildComplete","info","name","outputs","pages","pagesApi","appPages","appRoutes","prerenders","staticFiles","join","file","pathname","posix","filePath","push","type","STATIC_FILE","id","sharedNodeAssets","fileOutputPath","relative","assets","handleTraceFiles","Object","assign","traceFilePath","traceData","JSON","parse","readFile","traceFileDir","dirname","relativeFile","files","tracedFilePath","handleEdgeFunction","page","isMiddleware","PAGES","isAppPrefix","startsWith","isAppPage","endsWith","isAppRoute","currentOutputs","MIDDLEWARE","APP_PAGE","APP_ROUTE","PAGES_API","output","runtime","find","item","matchers","handleFile","originalPath","wasm","middleware","edgeFunctionHandlers","values","functions","pagesDistDir","pageOutputMap","hasOwnProperty","route","pageFile","has","replace","pageTraceFile","catch","err","code","warn","functionConfig","maxDuration","preferredRegion","regions","middlewareFile","middlewareTrace","appOutputMap","appDistDir","normalizedPage","getParentOutput","srcRoute","childRoute","allowMissing","parentOutput","console","error","appOutputs","keys","pageOutputs","Error","prefetchSegmentDirSuffix","prefetchSegmentSuffix","varyHeader","didPostponeHeader","contentTypeHeader","rscContentTypeHeader","rsc","handleAppMeta","initialOutput","meta","postponed","fallback","postponedState","segmentPaths","segmentsDir","segmentPath","outputSegmentPath","fallbackPathname","PRERENDER","parentOutputId","groupId","initialExpiration","initialRevalidate","initialHeaders","vary","prerenderGroupId","getAppRouteMeta","headers","key","keyLower","toLowerCase","value","routes","initialExpireSeconds","initialRevalidateSeconds","initialStatus","prefetchDataRoute","dataRoute","renderingMode","allowHeader","experimentalBypassFor","Boolean","isNotFoundTrue","notFoundRoutes","includes","allowQuery","routeKeys","dynamicRoutes","pprChain","experimental","ppr","undefined","bypassFor","bypassToken","preview","previewModeId","dataFilePath","PARTIALLY_STATIC","dynamicRoute","fallbackExpire","fallbackRevalidate","fallbackHeaders","fallbackStatus","rewrites","redirects","projectDir","repoRoot"],"mappings":"AAAA,OAAOA,UAAU,OAAM;AACvB,OAAOC,QAAQ,cAAa;AAC5B,SAASC,aAAa,QAAQ,MAAK;AACnC,YAAYC,SAAS,gBAAe;AACpC,SAASC,oBAAoB,QAAQ,WAAU;AAC/C,SAASC,aAAa,QAAQ,oBAAmB;AACjD,SAASC,cAAc,QAAQ,4BAA2B;AAE1D,SAASC,gBAAgB,QAAQ,8BAA6B;AAC9D,SAASC,cAAc,QAAQ,gCAA+B;AAI9D,SAASC,gBAAgB,QAAQ,0CAAyC;AAC1E,SAASC,iBAAiB,QAAyB,6BAA4B;AAC/E,SAASC,iBAAiB,QAAQ,iDAAgD;AAiBlF,SACEC,wBAAwB,EACxBC,wBAAwB,EACxBC,kBAAkB,QACb,sBAAqB;AAuQ5B,OAAO,eAAeC,oBAAoB,EACxCC,GAAG,EACHC,MAAM,EACNC,OAAO,EACPC,QAAQ,EACRC,WAAW,EACXC,WAAW,EACXC,WAAW,EACXC,WAAW,EACXC,WAAW,EACXC,YAAY,EACZC,cAAc,EACdC,iBAAiB,EACjBC,iBAAiB,EACjBC,kBAAkB,EAClBC,mBAAmB,EACnBC,sBAAsB,EACtBC,uBAAuB,EAmBxB;IACC,MAAMC,aAAa3B,eACjB,MAAM,MAAM,CAACJ,cAAcgC,QAAQC,OAAO,CAACd,cAAce,IAAI;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ACAN;wBACAD;wBACAc,WAAWZ;wBACXa,aAAa5J,kBAAkB6J,OAAO,CAACC,aAAa;oBACtD;oBACA5C,UACE,OAAOA,aAAa,WAChB;wBACE3F,UAAUnD,KAAK+C,IAAI,CACjBgC,YAAYuC,aAAanB,cACzB,oDAAoD;wBACpD,sCAAsC;wBACtC2C,SAAS9D,QAAQ,CAAC,WAAW8D,WAAW,GAAGA,SAAS,KAAK,CAAC;wBAE5DwB,eAAe2B;wBACfvC,gBAAgB;4BACd,GAAGsC,eAAe;4BAClB,gBAAgBpL;wBAClB;wBACA4I,mBAAmBsC;wBACnBrC,mBAAmBsC,sBAAsB;oBAC3C,IACAT;gBACR;gBACA9I,QAAQK,UAAU,CAACO,IAAI,CAACuF;gBAExB,IAAI5D,WAAW;oBACb,MAAM2D,cAAcmD,cAAclD,eAAeC;gBACnD;gBAEA,IAAI4B,WAAW;oBACbhI,QAAQK,UAAU,CAACO,IAAI,CAAC;wBACtB,GAAGuF,aAAa;wBAChBpF,IAAIiH;wBACJvH,UAAUuH;wBACV1B,UAAUwC;oBACZ;gBACF;gBACA1B,oBAAoB;YACtB;YAEA,MAAM3H,WAAWI,eAAe,CAAC;gBAC/B8H,QAAQ;oBACNe,eAAexJ,eAAewJ,aAAa;oBAC3CgB,UAAUxK,eAAewK,QAAQ;oBACjCC,WAAWzK,eAAeyK,SAAS;oBACnCrC,SAASpI,eAAeoI,OAAO;gBACjC;gBACAtH;gBAEAvB;gBACAC;gBACAM;gBACA4K,YAAYpL;gBACZqL,UAAUjL;YACZ;QACF,EAAE,OAAOwF,KAAK;YACZzG,IAAI2H,KAAK,CAAC,CAAC,mCAAmC,EAAE7F,WAAWM,IAAI,EAAE;YACjE,MAAMqE;QACR;IACF;AACF","ignoreList":[0]}
|
package/dist/esm/build/index.js
CHANGED
@@ -303,7 +303,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
|
|
303
303
|
const nextBuildSpan = trace('next-build', undefined, {
|
304
304
|
buildMode: experimentalBuildMode,
|
305
305
|
isTurboBuild: String(isTurbopack),
|
306
|
-
version: "15.6.0-canary.
|
306
|
+
version: "15.6.0-canary.4"
|
307
307
|
});
|
308
308
|
NextBuildContext.nextBuildSpan = nextBuildSpan;
|
309
309
|
NextBuildContext.dir = dir;
|
@@ -782,7 +782,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
|
|
782
782
|
// Files outside of the distDir can be "type": "module"
|
783
783
|
await writeFileUtf8(path.join(distDir, 'package.json'), '{"type": "commonjs"}');
|
784
784
|
// These are written to distDir, so they need to come after creating and cleaning distDr.
|
785
|
-
await recordFrameworkVersion("15.6.0-canary.
|
785
|
+
await recordFrameworkVersion("15.6.0-canary.4");
|
786
786
|
await updateBuildDiagnostics({
|
787
787
|
buildStage: 'start'
|
788
788
|
});
|
@@ -2441,7 +2441,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
|
|
2441
2441
|
distDir,
|
2442
2442
|
config,
|
2443
2443
|
staticPages,
|
2444
|
-
nextVersion: "15.6.0-canary.
|
2444
|
+
nextVersion: "15.6.0-canary.4",
|
2445
2445
|
tracingRoot: outputFileTracingRoot,
|
2446
2446
|
hasNodeMiddleware,
|
2447
2447
|
hasInstrumentationHook,
|
@@ -11,7 +11,7 @@ import { isDeepStrictEqual } from 'util';
|
|
11
11
|
import { getDefineEnv } from '../define-env';
|
12
12
|
import { getReactCompilerLoader } from '../get-babel-loader-config';
|
13
13
|
import { throwTurbopackInternalError } from '../../shared/lib/turbopack/internal-error';
|
14
|
-
const nextVersion = "15.6.0-canary.
|
14
|
+
const nextVersion = "15.6.0-canary.4";
|
15
15
|
const ArchName = arch();
|
16
16
|
const PlatformName = platform();
|
17
17
|
function infoLog(...args) {
|
@@ -1608,7 +1608,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
|
|
1608
1608
|
isClient && new CopyFilePlugin({
|
1609
1609
|
// file path to build output of `@next/polyfill-nomodule`
|
1610
1610
|
filePath: require.resolve('./polyfills/polyfill-nomodule'),
|
1611
|
-
cacheKey: "15.6.0-canary.
|
1611
|
+
cacheKey: "15.6.0-canary.4",
|
1612
1612
|
name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
|
1613
1613
|
minimize: false,
|
1614
1614
|
info: {
|
@@ -1792,7 +1792,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
|
|
1792
1792
|
// - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
|
1793
1793
|
// - Next.js version
|
1794
1794
|
// - next.config.js keys that affect compilation
|
1795
|
-
version: `${__dirname}|${"15.6.0-canary.
|
1795
|
+
version: `${__dirname}|${"15.6.0-canary.4"}|${configVars}`,
|
1796
1796
|
cacheDirectory: path.join(distDir, 'cache', 'webpack'),
|
1797
1797
|
// For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
|
1798
1798
|
// So we disable compression here and allow the build runner to take care of compressing the cache as a whole.
|
@@ -5,7 +5,7 @@
|
|
5
5
|
* - next/script with `beforeInteractive` strategy
|
6
6
|
*/ import { getAssetPrefix } from './asset-prefix';
|
7
7
|
import { setAttributesFromProps } from './set-attributes-from-props';
|
8
|
-
const version = "15.6.0-canary.
|
8
|
+
const version = "15.6.0-canary.4";
|
9
9
|
window.next = {
|
10
10
|
version,
|
11
11
|
appDir: true
|
package/dist/esm/client/index.js
CHANGED
@@ -26,7 +26,7 @@ import { SearchParamsContext, PathParamsContext } from '../shared/lib/hooks-clie
|
|
26
26
|
import { onRecoverableError } from './react-client-callbacks/on-recoverable-error';
|
27
27
|
import tracer from './tracing/tracer';
|
28
28
|
import { isNextRouterError } from './components/is-next-router-error';
|
29
|
-
export const version = "15.6.0-canary.
|
29
|
+
export const version = "15.6.0-canary.4";
|
30
30
|
export let router;
|
31
31
|
export const emitter = mitt();
|
32
32
|
const looseToArray = (input)=>[].slice.call(input);
|
@@ -90,7 +90,7 @@ export async function createHotReloaderTurbopack(opts, serverFields, distDir, re
|
|
90
90
|
}
|
91
91
|
const hasRewrites = opts.fsChecker.rewrites.afterFiles.length > 0 || opts.fsChecker.rewrites.beforeFiles.length > 0 || opts.fsChecker.rewrites.fallback.length > 0;
|
92
92
|
const hotReloaderSpan = trace('hot-reloader', undefined, {
|
93
|
-
version: "15.6.0-canary.
|
93
|
+
version: "15.6.0-canary.4"
|
94
94
|
});
|
95
95
|
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
|
96
96
|
// of the current `next dev` invocation.
|
@@ -158,7 +158,7 @@ export default class HotReloaderWebpack {
|
|
158
158
|
this.previewProps = previewProps;
|
159
159
|
this.rewrites = rewrites;
|
160
160
|
this.hotReloaderSpan = trace('hot-reloader', undefined, {
|
161
|
-
version: "15.6.0-canary.
|
161
|
+
version: "15.6.0-canary.4"
|
162
162
|
});
|
163
163
|
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
|
164
164
|
// of the current `next dev` invocation.
|
@@ -14,7 +14,7 @@ export function logStartInfo({ networkUrl, appUrl, envInfo, experimentalFeatures
|
|
14
14
|
bundlerSuffix = ' (webpack)';
|
15
15
|
}
|
16
16
|
}
|
17
|
-
Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"15.6.0-canary.
|
17
|
+
Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"15.6.0-canary.4"}`))}${bundlerSuffix}`);
|
18
18
|
if (appUrl) {
|
19
19
|
Log.bootstrap(`- Local: ${appUrl}`);
|
20
20
|
}
|
@@ -111,7 +111,7 @@ export async function getRequestHandlers({ dir, port, isDev, onDevServerCleanup,
|
|
111
111
|
export async function startServer(serverOptions) {
|
112
112
|
const { dir, isDev, hostname, minimalMode, allowRetry, keepAliveTimeout, selfSignedCertificate } = serverOptions;
|
113
113
|
let { port } = serverOptions;
|
114
|
-
process.title = `next-server (v${"15.6.0-canary.
|
114
|
+
process.title = `next-server (v${"15.6.0-canary.4"})`;
|
115
115
|
let handlersReady = ()=>{};
|
116
116
|
let handlersError = ()=>{};
|
117
117
|
let handlersPromise = new Promise((resolve, reject)=>{
|
@@ -18,7 +18,7 @@
|
|
18
18
|
* This ensures we suppress noisy prerender-related rejections while preserving
|
19
19
|
* normal error logging for genuine unhandled rejections.
|
20
20
|
*/ import { workUnitAsyncStorage } from '../app-render/work-unit-async-storage.external';
|
21
|
-
const MODE = process.env.
|
21
|
+
const MODE = process.env.NEXT_USE_UNHANDLED_REJECTION_FILTER;
|
22
22
|
let ENABLE_UHR_FILTER = false;
|
23
23
|
let DEBUG_UHR_FILTER = false;
|
24
24
|
switch(MODE){
|
@@ -38,7 +38,7 @@ switch(MODE){
|
|
38
38
|
break;
|
39
39
|
default:
|
40
40
|
if (typeof MODE === 'string') {
|
41
|
-
console.error(`
|
41
|
+
console.error(`NEXT_USE_UNHANDLED_REJECTION_FILTER has an unrecognized value: ${JSON.stringify(MODE)}. Use "enabled", "disabled", or "debug" or omit the environment variable altogether`);
|
42
42
|
}
|
43
43
|
}
|
44
44
|
const debug = DEBUG_UHR_FILTER ? (...args)=>console.log('[UNHANDLED REJECTION DEBUG]', ...args, new Error().stack) : undefined;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/server/node-environment-extensions/unhandled-rejection.tsx"],"sourcesContent":["/**\n * Manages unhandled rejection listeners to intelligently filter rejections\n * from aborted prerenders when cache components are enabled.\n *\n * THE PROBLEM:\n * When we abort prerenders we expect to find numerous unhandled promise rejections due to\n * things like awaiting Request data like `headers()`. The rejections are fine and should\n * not be construed as problematic so we need to avoid the appearance of a problem by\n * omitting them from the logged output.\n *\n * THE STRATEGY:\n * 1. Install a filtering unhandled rejection handler\n * 2. Intercept process event methods to capture new handlers in our internal queue\n * 3. For each rejection, check if it comes from an aborted prerender context\n * 4. If yes, suppress it. If no, delegate to all handlers in our queue\n * 5. This provides precise filtering without time-based windows\n *\n * This ensures we suppress noisy prerender-related rejections while preserving\n * normal error logging for genuine unhandled rejections.\n */\n\nimport { workUnitAsyncStorage } from '../app-render/work-unit-async-storage.external'\n\nconst MODE:\n | 'enabled'\n | 'debug'\n | 'true'\n | 'false'\n | '1'\n | '0'\n | ''\n | string\n | undefined = process.env.__NEXT_USE_UNHANDLED_REJECTION_FILTER\n\nlet ENABLE_UHR_FILTER = false\nlet DEBUG_UHR_FILTER = false\n\nswitch (MODE) {\n case 'debug':\n DEBUG_UHR_FILTER = true\n // fallthrough\n case 'enabled':\n case 'true':\n case '1':\n ENABLE_UHR_FILTER = true\n break\n case 'false':\n case 'disabled':\n case '0':\n case '':\n case undefined:\n break\n default:\n if (typeof MODE === 'string') {\n console.error(\n `__NEXT_USE_UNHANDLED_REJECTION_FILTER has an unrecognized value: ${JSON.stringify(MODE)}. Use \"enabled\", \"disabled\", or \"debug\" or omit the environment variable altogether`\n )\n }\n}\n\nconst debug = DEBUG_UHR_FILTER\n ? (...args: any[]) =>\n console.log('[UNHANDLED REJECTION DEBUG]', ...args, new Error().stack)\n : undefined\n\ntype ListenerMetadata = {\n listener: NodeJS.UnhandledRejectionListener\n once: boolean\n}\n\nlet filterInstalled = false\n\n// We store the proxied listeners for unhandled rejections here.\nlet underlyingListeners: Array<NodeJS.UnhandledRejectionListener> = []\n// We store a unique pointer to each event listener registration to track\n// details like whether the listener is a once listener.\nlet listenerMetadata: Array<ListenerMetadata> = []\n\nlet originalProcessOn: typeof process.on\nlet originalProcessAddListener: typeof process.addListener\nlet originalProcessOnce: typeof process.once\nlet originalProcessRemoveListener: typeof process.removeListener\nlet originalProcessRemoveAllListeners: typeof process.removeAllListeners\nlet originalProcessListeners: typeof process.listeners\nlet originalProcessPrependListener: typeof process.prependListener\nlet originalProcessPrependOnceListener: typeof process.prependOnceListener\nlet originalProcessOff: typeof process.off\n\nlet didWarnPrepend = false\nlet didWarnRemoveAll = false\n\n/**\n * Installs a filtering unhandled rejection handler that intelligently suppresses\n * rejections from aborted prerender contexts.\n *\n * This should be called once during server startup to install the global filter.\n */\nfunction installUnhandledRejectionFilter(): void {\n if (filterInstalled) {\n debug?.('unexpected second install')\n return\n }\n\n debug?.(\n 'installUnhandledRejectionFilter',\n process.listeners('unhandledRejection').map((l) => l.toString())\n )\n\n // Capture existing handlers\n underlyingListeners = Array.from(process.listeners('unhandledRejection'))\n // We assume all existing handlers are not \"once\"\n listenerMetadata = underlyingListeners.map((l) => ({\n listener: l,\n once: false,\n }))\n\n // Store the original process methods\n originalProcessOn = process.on\n originalProcessAddListener = process.addListener\n originalProcessOnce = process.once\n originalProcessOff = process.off\n originalProcessRemoveListener = process.removeListener\n originalProcessRemoveAllListeners = process.removeAllListeners\n originalProcessListeners = process.listeners\n originalProcessPrependListener = process.prependListener\n originalProcessPrependOnceListener = process.prependOnceListener\n\n // Helper function to create a patched method that preserves toString behavior\n function patchMethod<T extends Function>(original: T, patchedImpl: T): T {\n // Preserve the original toString behavior\n Object.defineProperty(patchedImpl, 'toString', {\n value: original.toString.bind(original),\n writable: true,\n configurable: true,\n })\n return patchedImpl\n }\n\n // Intercept process.on to capture new unhandled rejection handlers\n process.on = patchMethod(originalProcessOn, function (\n event: string | symbol,\n listener: (...args: any[]) => void\n ) {\n if (event === 'unhandledRejection') {\n debug?.('process.on/addListener', listener.toString())\n // Add new handlers to our internal queue instead of the process\n underlyingListeners.push(listener as NodeJS.UnhandledRejectionListener)\n listenerMetadata.push({ listener, once: false })\n return process\n }\n // For other events, use the original method\n return originalProcessOn.call(process, event, listener)\n } as typeof process.on)\n\n // Intercept process.addListener (alias for process.on)\n process.addListener = patchMethod(\n originalProcessAddListener,\n process.on as typeof originalProcessAddListener\n )\n\n // Intercept process.once for one-time handlers\n process.once = patchMethod(originalProcessOnce, function (\n event: string | symbol,\n listener: (...args: any[]) => void\n ) {\n if (event === 'unhandledRejection') {\n debug?.('process.once', listener.toString())\n underlyingListeners.push(listener)\n listenerMetadata.push({ listener, once: true })\n return process\n }\n // For other events, use the original method\n return originalProcessOnce.call(process, event, listener)\n } as typeof process.once)\n\n // Intercept process.prependListener for handlers that should go first\n process.prependListener = patchMethod(\n originalProcessPrependListener,\n function (event: string | symbol, listener: (...args: any[]) => void) {\n if (event === 'unhandledRejection') {\n debug?.('process.prependListener', listener.toString())\n if (didWarnPrepend === false) {\n didWarnPrepend = true\n console.warn(\n 'Warning: `prependListener(\"unhandledRejection\")` called, but Next.js maintains the first listener ' +\n 'which filters out unnecessary events from aborted prerenders. Your handler will be second.'\n )\n }\n // Add new handlers to the beginning of our internal queue\n underlyingListeners.unshift(\n listener as NodeJS.UnhandledRejectionListener\n )\n listenerMetadata.unshift({ listener, once: false })\n return process\n }\n // For other events, use the original method\n return originalProcessPrependListener.call(\n process,\n event as any,\n listener\n )\n } as typeof process.prependListener\n )\n\n // Intercept process.prependOnceListener for one-time handlers that should go first\n process.prependOnceListener = patchMethod(\n originalProcessPrependOnceListener,\n function (event: string | symbol, listener: (...args: any[]) => void) {\n if (event === 'unhandledRejection') {\n debug?.('process.prependOnceListener', listener.toString())\n if (didWarnPrepend === false) {\n didWarnPrepend = true\n console.warn(\n 'Warning: `prependOnceListener(\"unhandledRejection\")` called, but Next.js maintains the first listener ' +\n 'which filters out unnecessary events from aborted prerenders. Your handler will be second.'\n )\n }\n // Add to the beginning of our internal queue\n underlyingListeners.unshift(listener)\n listenerMetadata.unshift({ listener, once: true })\n return process\n }\n // For other events, use the original method\n return originalProcessPrependOnceListener.call(\n process,\n event as any,\n listener\n )\n } as typeof process.prependOnceListener\n )\n\n // Intercept process.removeListener\n process.removeListener = patchMethod(originalProcessRemoveListener, function (\n event: string | symbol,\n listener: (...args: any[]) => void\n ) {\n if (event === 'unhandledRejection') {\n debug?.('process.removeListener', listener.toString())\n // Check if they're trying to remove our filtering handler\n if (listener === filteringUnhandledRejectionHandler) {\n uninstallUnhandledRejectionFilter()\n return process\n }\n\n const index = underlyingListeners.lastIndexOf(listener)\n if (index > -1) {\n debug?.('process.removeListener match found', index)\n underlyingListeners.splice(index, 1)\n listenerMetadata.splice(index, 1)\n } else {\n debug?.('process.removeListener match not found', index)\n }\n return process\n }\n // For other events, use the original method\n return originalProcessRemoveListener.call(process, event, listener)\n } as typeof process.removeListener)\n\n // Intercept process.off (alias for process.removeListener)\n process.off = patchMethod(\n originalProcessOff,\n process.removeListener as typeof originalProcessOff\n )\n\n // Intercept process.removeAllListeners\n process.removeAllListeners = patchMethod(\n originalProcessRemoveAllListeners,\n function (event?: string | symbol) {\n if (event === 'unhandledRejection') {\n debug?.(\n 'process.removeAllListeners',\n underlyingListeners.map((l) => l.toString())\n )\n if (didWarnRemoveAll === false) {\n didWarnRemoveAll = true\n console.warn(\n 'Warning: `removeAllListeners(\"unhandledRejection\")` called. Next.js maintains an `unhandledRejection` listener ' +\n 'to filter out unnecessary rejection warnings caused by aborting prerenders early. It is not recommended that you ' +\n 'uninstall this behavior, but if you want to you must call `process.removeListener(\"unhandledRejection\", listener)`. ' +\n 'You can acquire the listener from `process.listeners(\"unhandledRejection\")[0]`.'\n )\n }\n underlyingListeners.length = 0\n listenerMetadata.length = 0\n return process\n }\n\n // For other specific events, use the original method\n if (event !== undefined) {\n return originalProcessRemoveAllListeners.call(process, event)\n }\n\n // If no event specified (removeAllListeners()), uninstall our patch completely\n console.warn(\n 'Warning: `removeAllListeners()` called - uninstalling Next.js unhandled rejection filter. ' +\n 'You will observe `unhandledRejection` logs from prerendering which are not problematic.'\n )\n uninstallUnhandledRejectionFilter()\n return originalProcessRemoveAllListeners.call(process)\n } as typeof process.removeAllListeners\n )\n\n // Intercept process.listeners to return our internal handlers for unhandled rejection\n process.listeners = patchMethod(originalProcessListeners, function (\n event: string | symbol\n ) {\n if (event === 'unhandledRejection') {\n debug?.(\n 'process.listeners',\n [filteringUnhandledRejectionHandler, ...underlyingListeners].map((l) =>\n l.toString()\n )\n )\n return [filteringUnhandledRejectionHandler, ...underlyingListeners]\n }\n return originalProcessListeners.call(process, event as any)\n } as typeof process.listeners)\n\n // Remove all existing handlers\n originalProcessRemoveAllListeners.call(process, 'unhandledRejection')\n\n // Install our filtering handler\n originalProcessOn.call(\n process,\n 'unhandledRejection',\n filteringUnhandledRejectionHandler\n )\n\n originalProcessOn.call(process, 'rejectionHandled', noopRejectionHandled)\n\n filterInstalled = true\n\n debug?.(\n 'after install actual listeners',\n originalProcessListeners\n .call(process, 'unhandledRejection' as any)\n .map((l) => l.toString())\n )\n\n debug?.(\n 'after install listeners',\n process.listeners('unhandledRejection').map((l) => l.toString())\n )\n}\n\n/**\n * Uninstalls the unhandled rejection filter and restores original process methods.\n * This is called when someone explicitly removes our filtering handler.\n * @internal\n */\nfunction uninstallUnhandledRejectionFilter(): void {\n if (!filterInstalled) {\n debug?.('unexpected second uninstall')\n return\n }\n\n debug?.(\n 'uninstallUnhandledRejectionFilter',\n [filteringUnhandledRejectionHandler, ...underlyingListeners].map((l) =>\n l.toString()\n )\n )\n\n // Restore original process methods\n process.on = originalProcessOn\n process.addListener = originalProcessAddListener\n process.once = originalProcessOnce\n process.prependListener = originalProcessPrependListener\n process.prependOnceListener = originalProcessPrependOnceListener\n process.removeListener = originalProcessRemoveListener\n process.off = originalProcessOff\n process.removeAllListeners = originalProcessRemoveAllListeners\n process.listeners = originalProcessListeners\n\n // Remove our filtering handler\n originalProcessRemoveListener.call(\n process,\n 'unhandledRejection',\n filteringUnhandledRejectionHandler\n )\n\n originalProcessRemoveListener.call(\n process,\n 'rejectionHandled',\n noopRejectionHandled\n )\n\n // Re-register all the handlers that were in our internal queue\n for (const meta of listenerMetadata) {\n if (meta.once) {\n originalProcessOnce.call(process, 'unhandledRejection', meta.listener)\n } else {\n originalProcessOn.call(process, 'unhandledRejection', meta.listener)\n }\n }\n\n // Reset state\n filterInstalled = false\n underlyingListeners.length = 0\n listenerMetadata.length = 0\n\n debug?.(\n 'after uninstall',\n process.listeners('unhandledRejection').map((l) => l.toString())\n )\n}\n\n/**\n * The filtering handler that decides whether to suppress or delegate unhandled rejections.\n */\nfunction filteringUnhandledRejectionHandler(\n reason: any,\n promise: Promise<any>\n): void {\n const capturedListenerMetadata = Array.from(listenerMetadata)\n\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'prerender':\n case 'prerender-client':\n case 'prerender-runtime': {\n const signal = workUnitStore.renderSignal\n if (signal.aborted) {\n // This unhandledRejection is from async work spawned in a now\n // aborted prerender. We don't need to report this.\n return\n }\n break\n }\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'request':\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n break\n default:\n workUnitStore satisfies never\n }\n }\n\n // Not from an aborted prerender, delegate to original handlers\n if (capturedListenerMetadata.length === 0) {\n // We need to log something because the default behavior when there is\n // no event handler installed is to trigger an Unhandled Exception.\n // We don't do that here b/c we don't want to rely on this implicit default\n // to kill the process since it can be disabled by installing a userland listener\n // and you may also choose to run Next.js with args such that unhandled rejections\n // do not automatically terminate the process.\n console.error('Unhandled Rejection:', reason)\n } else {\n try {\n for (const meta of capturedListenerMetadata) {\n if (meta.once) {\n // This is a once listener. we remove it from our set before we call it\n const index = listenerMetadata.indexOf(meta)\n if (index !== -1) {\n underlyingListeners.splice(index, 1)\n listenerMetadata.splice(index, 1)\n }\n }\n const listener = meta.listener\n listener(reason, promise)\n }\n } catch (error) {\n // If any handlers error we produce an Uncaught Exception\n setImmediate(() => {\n throw error\n })\n }\n }\n}\n\nfunction noopRejectionHandled() {}\n\n// Install the filter when this module is imported\nif (ENABLE_UHR_FILTER) {\n installUnhandledRejectionFilter()\n}\n"],"names":["workUnitAsyncStorage","MODE","process","env","__NEXT_USE_UNHANDLED_REJECTION_FILTER","ENABLE_UHR_FILTER","DEBUG_UHR_FILTER","undefined","console","error","JSON","stringify","debug","args","log","Error","stack","filterInstalled","underlyingListeners","listenerMetadata","originalProcessOn","originalProcessAddListener","originalProcessOnce","originalProcessRemoveListener","originalProcessRemoveAllListeners","originalProcessListeners","originalProcessPrependListener","originalProcessPrependOnceListener","originalProcessOff","didWarnPrepend","didWarnRemoveAll","installUnhandledRejectionFilter","listeners","map","l","toString","Array","from","listener","once","on","addListener","off","removeListener","removeAllListeners","prependListener","prependOnceListener","patchMethod","original","patchedImpl","Object","defineProperty","value","bind","writable","configurable","event","push","call","warn","unshift","filteringUnhandledRejectionHandler","uninstallUnhandledRejectionFilter","index","lastIndexOf","splice","length","noopRejectionHandled","meta","reason","promise","capturedListenerMetadata","workUnitStore","getStore","type","signal","renderSignal","aborted","indexOf","setImmediate"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;CAmBC,GAED,SAASA,oBAAoB,QAAQ,iDAAgD;AAErF,MAAMC,OASUC,QAAQC,GAAG,CAACC,qCAAqC;AAEjE,IAAIC,oBAAoB;AACxB,IAAIC,mBAAmB;AAEvB,OAAQL;IACN,KAAK;QACHK,mBAAmB;IACrB,cAAc;IACd,KAAK;IACL,KAAK;IACL,KAAK;QACHD,oBAAoB;QACpB;IACF,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAKE;QACH;IACF;QACE,IAAI,OAAON,SAAS,UAAU;YAC5BO,QAAQC,KAAK,CACX,CAAC,iEAAiE,EAAEC,KAAKC,SAAS,CAACV,MAAM,mFAAmF,CAAC;QAEjL;AACJ;AAEA,MAAMW,QAAQN,mBACV,CAAC,GAAGO,OACFL,QAAQM,GAAG,CAAC,kCAAkCD,MAAM,IAAIE,QAAQC,KAAK,IACvET;AAOJ,IAAIU,kBAAkB;AAEtB,gEAAgE;AAChE,IAAIC,sBAAgE,EAAE;AACtE,yEAAyE;AACzE,wDAAwD;AACxD,IAAIC,mBAA4C,EAAE;AAElD,IAAIC;AACJ,IAAIC;AACJ,IAAIC;AACJ,IAAIC;AACJ,IAAIC;AACJ,IAAIC;AACJ,IAAIC;AACJ,IAAIC;AACJ,IAAIC;AAEJ,IAAIC,iBAAiB;AACrB,IAAIC,mBAAmB;AAEvB;;;;;CAKC,GACD,SAASC;IACP,IAAId,iBAAiB;QACnBL,yBAAAA,MAAQ;QACR;IACF;IAEAA,yBAAAA,MACE,mCACAV,QAAQ8B,SAAS,CAAC,sBAAsBC,GAAG,CA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EAAE;oBACb,uEAAuE;oBACvE,MAAMwB,QAAQ5C,iBAAiB2D,OAAO,CAACV;oBACvC,IAAIL,UAAU,CAAC,GAAG;wBAChB7C,oBAAoB+C,MAAM,CAACF,OAAO;wBAClC5C,iBAAiB8C,MAAM,CAACF,OAAO;oBACjC;gBACF;gBACA,MAAMzB,WAAW8B,KAAK9B,QAAQ;gBAC9BA,SAAS+B,QAAQC;YACnB;QACF,EAAE,OAAO7D,OAAO;YACd,yDAAyD;YACzDsE,aAAa;gBACX,MAAMtE;YACR;QACF;IACF;AACF;AAEA,SAAS0D,wBAAwB;AAEjC,kDAAkD;AAClD,IAAI9D,mBAAmB;IACrB0B;AACF","ignoreList":[0]}
|
1
|
+
{"version":3,"sources":["../../../src/server/node-environment-extensions/unhandled-rejection.tsx"],"sourcesContent":["/**\n * Manages unhandled rejection listeners to intelligently filter rejections\n * from aborted prerenders when cache components are enabled.\n *\n * THE PROBLEM:\n * When we abort prerenders we expect to find numerous unhandled promise rejections due to\n * things like awaiting Request data like `headers()`. The rejections are fine and should\n * not be construed as problematic so we need to avoid the appearance of a problem by\n * omitting them from the logged output.\n *\n * THE STRATEGY:\n * 1. Install a filtering unhandled rejection handler\n * 2. Intercept process event methods to capture new handlers in our internal queue\n * 3. For each rejection, check if it comes from an aborted prerender context\n * 4. If yes, suppress it. If no, delegate to all handlers in our queue\n * 5. This provides precise filtering without time-based windows\n *\n * This ensures we suppress noisy prerender-related rejections while preserving\n * normal error logging for genuine unhandled rejections.\n */\n\nimport { workUnitAsyncStorage } from '../app-render/work-unit-async-storage.external'\n\nconst MODE:\n | 'enabled'\n | 'debug'\n | 'true'\n | 'false'\n | '1'\n | '0'\n | ''\n | string\n | undefined = process.env.NEXT_USE_UNHANDLED_REJECTION_FILTER\n\nlet ENABLE_UHR_FILTER = false\nlet DEBUG_UHR_FILTER = false\n\nswitch (MODE) {\n case 'debug':\n DEBUG_UHR_FILTER = true\n // fallthrough\n case 'enabled':\n case 'true':\n case '1':\n ENABLE_UHR_FILTER = true\n break\n case 'false':\n case 'disabled':\n case '0':\n case '':\n case undefined:\n break\n default:\n if (typeof MODE === 'string') {\n console.error(\n `NEXT_USE_UNHANDLED_REJECTION_FILTER has an unrecognized value: ${JSON.stringify(MODE)}. Use \"enabled\", \"disabled\", or \"debug\" or omit the environment variable altogether`\n )\n }\n}\n\nconst debug = DEBUG_UHR_FILTER\n ? (...args: any[]) =>\n console.log('[UNHANDLED REJECTION DEBUG]', ...args, new Error().stack)\n : undefined\n\ntype ListenerMetadata = {\n listener: NodeJS.UnhandledRejectionListener\n once: boolean\n}\n\nlet filterInstalled = false\n\n// We store the proxied listeners for unhandled rejections here.\nlet underlyingListeners: Array<NodeJS.UnhandledRejectionListener> = []\n// We store a unique pointer to each event listener registration to track\n// details like whether the listener is a once listener.\nlet listenerMetadata: Array<ListenerMetadata> = []\n\nlet originalProcessOn: typeof process.on\nlet originalProcessAddListener: typeof process.addListener\nlet originalProcessOnce: typeof process.once\nlet originalProcessRemoveListener: typeof process.removeListener\nlet originalProcessRemoveAllListeners: typeof process.removeAllListeners\nlet originalProcessListeners: typeof process.listeners\nlet originalProcessPrependListener: typeof process.prependListener\nlet originalProcessPrependOnceListener: typeof process.prependOnceListener\nlet originalProcessOff: typeof process.off\n\nlet didWarnPrepend = false\nlet didWarnRemoveAll = false\n\n/**\n * Installs a filtering unhandled rejection handler that intelligently suppresses\n * rejections from aborted prerender contexts.\n *\n * This should be called once during server startup to install the global filter.\n */\nfunction installUnhandledRejectionFilter(): void {\n if (filterInstalled) {\n debug?.('unexpected second install')\n return\n }\n\n debug?.(\n 'installUnhandledRejectionFilter',\n process.listeners('unhandledRejection').map((l) => l.toString())\n )\n\n // Capture existing handlers\n underlyingListeners = Array.from(process.listeners('unhandledRejection'))\n // We assume all existing handlers are not \"once\"\n listenerMetadata = underlyingListeners.map((l) => ({\n listener: l,\n once: false,\n }))\n\n // Store the original process methods\n originalProcessOn = process.on\n originalProcessAddListener = process.addListener\n originalProcessOnce = process.once\n originalProcessOff = process.off\n originalProcessRemoveListener = process.removeListener\n originalProcessRemoveAllListeners = process.removeAllListeners\n originalProcessListeners = process.listeners\n originalProcessPrependListener = process.prependListener\n originalProcessPrependOnceListener = process.prependOnceListener\n\n // Helper function to create a patched method that preserves toString behavior\n function patchMethod<T extends Function>(original: T, patchedImpl: T): T {\n // Preserve the original toString behavior\n Object.defineProperty(patchedImpl, 'toString', {\n value: original.toString.bind(original),\n writable: true,\n configurable: true,\n })\n return patchedImpl\n }\n\n // Intercept process.on to capture new unhandled rejection handlers\n process.on = patchMethod(originalProcessOn, function (\n event: string | symbol,\n listener: (...args: any[]) => void\n ) {\n if (event === 'unhandledRejection') {\n debug?.('process.on/addListener', listener.toString())\n // Add new handlers to our internal queue instead of the process\n underlyingListeners.push(listener as NodeJS.UnhandledRejectionListener)\n listenerMetadata.push({ listener, once: false })\n return process\n }\n // For other events, use the original method\n return originalProcessOn.call(process, event, listener)\n } as typeof process.on)\n\n // Intercept process.addListener (alias for process.on)\n process.addListener = patchMethod(\n originalProcessAddListener,\n process.on as typeof originalProcessAddListener\n )\n\n // Intercept process.once for one-time handlers\n process.once = patchMethod(originalProcessOnce, function (\n event: string | symbol,\n listener: (...args: any[]) => void\n ) {\n if (event === 'unhandledRejection') {\n debug?.('process.once', listener.toString())\n underlyingListeners.push(listener)\n listenerMetadata.push({ listener, once: true })\n return process\n }\n // For other events, use the original method\n return originalProcessOnce.call(process, event, listener)\n } as typeof process.once)\n\n // Intercept process.prependListener for handlers that should go first\n process.prependListener = patchMethod(\n originalProcessPrependListener,\n function (event: string | symbol, listener: (...args: any[]) => void) {\n if (event === 'unhandledRejection') {\n debug?.('process.prependListener', listener.toString())\n if (didWarnPrepend === false) {\n didWarnPrepend = true\n console.warn(\n 'Warning: `prependListener(\"unhandledRejection\")` called, but Next.js maintains the first listener ' +\n 'which filters out unnecessary events from aborted prerenders. Your handler will be second.'\n )\n }\n // Add new handlers to the beginning of our internal queue\n underlyingListeners.unshift(\n listener as NodeJS.UnhandledRejectionListener\n )\n listenerMetadata.unshift({ listener, once: false })\n return process\n }\n // For other events, use the original method\n return originalProcessPrependListener.call(\n process,\n event as any,\n listener\n )\n } as typeof process.prependListener\n )\n\n // Intercept process.prependOnceListener for one-time handlers that should go first\n process.prependOnceListener = patchMethod(\n originalProcessPrependOnceListener,\n function (event: string | symbol, listener: (...args: any[]) => void) {\n if (event === 'unhandledRejection') {\n debug?.('process.prependOnceListener', listener.toString())\n if (didWarnPrepend === false) {\n didWarnPrepend = true\n console.warn(\n 'Warning: `prependOnceListener(\"unhandledRejection\")` called, but Next.js maintains the first listener ' +\n 'which filters out unnecessary events from aborted prerenders. Your handler will be second.'\n )\n }\n // Add to the beginning of our internal queue\n underlyingListeners.unshift(listener)\n listenerMetadata.unshift({ listener, once: true })\n return process\n }\n // For other events, use the original method\n return originalProcessPrependOnceListener.call(\n process,\n event as any,\n listener\n )\n } as typeof process.prependOnceListener\n )\n\n // Intercept process.removeListener\n process.removeListener = patchMethod(originalProcessRemoveListener, function (\n event: string | symbol,\n listener: (...args: any[]) => void\n ) {\n if (event === 'unhandledRejection') {\n debug?.('process.removeListener', listener.toString())\n // Check if they're trying to remove our filtering handler\n if (listener === filteringUnhandledRejectionHandler) {\n uninstallUnhandledRejectionFilter()\n return process\n }\n\n const index = underlyingListeners.lastIndexOf(listener)\n if (index > -1) {\n debug?.('process.removeListener match found', index)\n underlyingListeners.splice(index, 1)\n listenerMetadata.splice(index, 1)\n } else {\n debug?.('process.removeListener match not found', index)\n }\n return process\n }\n // For other events, use the original method\n return originalProcessRemoveListener.call(process, event, listener)\n } as typeof process.removeListener)\n\n // Intercept process.off (alias for process.removeListener)\n process.off = patchMethod(\n originalProcessOff,\n process.removeListener as typeof originalProcessOff\n )\n\n // Intercept process.removeAllListeners\n process.removeAllListeners = patchMethod(\n originalProcessRemoveAllListeners,\n function (event?: string | symbol) {\n if (event === 'unhandledRejection') {\n debug?.(\n 'process.removeAllListeners',\n underlyingListeners.map((l) => l.toString())\n )\n if (didWarnRemoveAll === false) {\n didWarnRemoveAll = true\n console.warn(\n 'Warning: `removeAllListeners(\"unhandledRejection\")` called. Next.js maintains an `unhandledRejection` listener ' +\n 'to filter out unnecessary rejection warnings caused by aborting prerenders early. It is not recommended that you ' +\n 'uninstall this behavior, but if you want to you must call `process.removeListener(\"unhandledRejection\", listener)`. ' +\n 'You can acquire the listener from `process.listeners(\"unhandledRejection\")[0]`.'\n )\n }\n underlyingListeners.length = 0\n listenerMetadata.length = 0\n return process\n }\n\n // For other specific events, use the original method\n if (event !== undefined) {\n return originalProcessRemoveAllListeners.call(process, event)\n }\n\n // If no event specified (removeAllListeners()), uninstall our patch completely\n console.warn(\n 'Warning: `removeAllListeners()` called - uninstalling Next.js unhandled rejection filter. ' +\n 'You will observe `unhandledRejection` logs from prerendering which are not problematic.'\n )\n uninstallUnhandledRejectionFilter()\n return originalProcessRemoveAllListeners.call(process)\n } as typeof process.removeAllListeners\n )\n\n // Intercept process.listeners to return our internal handlers for unhandled rejection\n process.listeners = patchMethod(originalProcessListeners, function (\n event: string | symbol\n ) {\n if (event === 'unhandledRejection') {\n debug?.(\n 'process.listeners',\n [filteringUnhandledRejectionHandler, ...underlyingListeners].map((l) =>\n l.toString()\n )\n )\n return [filteringUnhandledRejectionHandler, ...underlyingListeners]\n }\n return originalProcessListeners.call(process, event as any)\n } as typeof process.listeners)\n\n // Remove all existing handlers\n originalProcessRemoveAllListeners.call(process, 'unhandledRejection')\n\n // Install our filtering handler\n originalProcessOn.call(\n process,\n 'unhandledRejection',\n filteringUnhandledRejectionHandler\n )\n\n originalProcessOn.call(process, 'rejectionHandled', noopRejectionHandled)\n\n filterInstalled = true\n\n debug?.(\n 'after install actual listeners',\n originalProcessListeners\n .call(process, 'unhandledRejection' as any)\n .map((l) => l.toString())\n )\n\n debug?.(\n 'after install listeners',\n process.listeners('unhandledRejection').map((l) => l.toString())\n )\n}\n\n/**\n * Uninstalls the unhandled rejection filter and restores original process methods.\n * This is called when someone explicitly removes our filtering handler.\n * @internal\n */\nfunction uninstallUnhandledRejectionFilter(): void {\n if (!filterInstalled) {\n debug?.('unexpected second uninstall')\n return\n }\n\n debug?.(\n 'uninstallUnhandledRejectionFilter',\n [filteringUnhandledRejectionHandler, ...underlyingListeners].map((l) =>\n l.toString()\n )\n )\n\n // Restore original process methods\n process.on = originalProcessOn\n process.addListener = originalProcessAddListener\n process.once = originalProcessOnce\n process.prependListener = originalProcessPrependListener\n process.prependOnceListener = originalProcessPrependOnceListener\n process.removeListener = originalProcessRemoveListener\n process.off = originalProcessOff\n process.removeAllListeners = originalProcessRemoveAllListeners\n process.listeners = originalProcessListeners\n\n // Remove our filtering handler\n originalProcessRemoveListener.call(\n process,\n 'unhandledRejection',\n filteringUnhandledRejectionHandler\n )\n\n originalProcessRemoveListener.call(\n process,\n 'rejectionHandled',\n noopRejectionHandled\n )\n\n // Re-register all the handlers that were in our internal queue\n for (const meta of listenerMetadata) {\n if (meta.once) {\n originalProcessOnce.call(process, 'unhandledRejection', meta.listener)\n } else {\n originalProcessOn.call(process, 'unhandledRejection', meta.listener)\n }\n }\n\n // Reset state\n filterInstalled = false\n underlyingListeners.length = 0\n listenerMetadata.length = 0\n\n debug?.(\n 'after uninstall',\n process.listeners('unhandledRejection').map((l) => l.toString())\n )\n}\n\n/**\n * The filtering handler that decides whether to suppress or delegate unhandled rejections.\n */\nfunction filteringUnhandledRejectionHandler(\n reason: any,\n promise: Promise<any>\n): void {\n const capturedListenerMetadata = Array.from(listenerMetadata)\n\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'prerender':\n case 'prerender-client':\n case 'prerender-runtime': {\n const signal = workUnitStore.renderSignal\n if (signal.aborted) {\n // This unhandledRejection is from async work spawned in a now\n // aborted prerender. We don't need to report this.\n return\n }\n break\n }\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'request':\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n break\n default:\n workUnitStore satisfies never\n }\n }\n\n // Not from an aborted prerender, delegate to original handlers\n if (capturedListenerMetadata.length === 0) {\n // We need to log something because the default behavior when there is\n // no event handler installed is to trigger an Unhandled Exception.\n // We don't do that here b/c we don't want to rely on this implicit default\n // to kill the process since it can be disabled by installing a userland listener\n // and you may also choose to run Next.js with args such that unhandled rejections\n // do not automatically terminate the process.\n console.error('Unhandled Rejection:', reason)\n } else {\n try {\n for (const meta of capturedListenerMetadata) {\n if (meta.once) {\n // This is a once listener. we remove it from our set before we call it\n const index = listenerMetadata.indexOf(meta)\n if (index !== -1) {\n underlyingListeners.splice(index, 1)\n listenerMetadata.splice(index, 1)\n }\n }\n const listener = meta.listener\n listener(reason, promise)\n }\n } catch (error) {\n // If any handlers error we produce an Uncaught Exception\n setImmediate(() => {\n throw error\n })\n }\n }\n}\n\nfunction noopRejectionHandled() {}\n\n// Install the filter when this module is imported\nif (ENABLE_UHR_FILTER) {\n installUnhandledRejectionFilter()\n}\n"],"names":["workUnitAsyncStorage","MODE","process","env","NEXT_USE_UNHANDLED_REJECTION_FILTER","ENABLE_UHR_FILTER","DEBUG_UHR_FILTER","undefined","console","error","JSON","stringify","debug","args","log","Error","stack","filterInstalled","underlyingListeners","listenerMetadata","originalProcessOn","originalProcessAddListener","originalProcessOnce","originalProcessRemoveListener","originalProcessRemoveAllListeners","originalProcessListeners","originalProcessPrependListener","originalProcessPrependOnceListener","originalProcessOff","didWarnPrepend","didWarnRemoveAll","installUnhandledRejectionFilter","listeners","map","l","toString","Array","from","listener","once","on","addListener","off","removeListener","removeAllListeners","prependListener","prependOnceListener","patchMethod","original","patchedImpl","Object","defineProperty","value","bind","writable","configurable","event","push","call","warn","unshift","filteringUnhandledRejectionHandler","uninstallUnhandledRejectionFilter","index","lastIndexOf","splice","length","noopRejectionHandled","meta","reason","promise","capturedListenerMetadata","workUnitStore","getStore","type","signal","renderSignal","aborted","indexOf","setImmediate"],"mappings":"AAAA;;;;;;;;;;;;;;;;;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YACnB;QACF,EAAE,OAAO7D,OAAO;YACd,yDAAyD;YACzDsE,aAAa;gBACX,MAAMtE;YACR;QACF;IACF;AACF;AAEA,SAAS0D,wBAAwB;AAEjC,kDAAkD;AAClD,IAAI9D,mBAAmB;IACrB0B;AACF","ignoreList":[0]}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
export function isStableBuild() {
|
2
2
|
var _process_env___NEXT_VERSION;
|
3
|
-
return !((_process_env___NEXT_VERSION = "15.6.0-canary.
|
3
|
+
return !((_process_env___NEXT_VERSION = "15.6.0-canary.4") == null ? void 0 : _process_env___NEXT_VERSION.includes('canary')) && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV;
|
4
4
|
}
|
5
5
|
export class CanaryOnlyError extends Error {
|
6
6
|
constructor(arg){
|
@@ -146,7 +146,7 @@ async function createHotReloaderTurbopack(opts, serverFields, distDir, resetFetc
|
|
146
146
|
}
|
147
147
|
const hasRewrites = opts.fsChecker.rewrites.afterFiles.length > 0 || opts.fsChecker.rewrites.beforeFiles.length > 0 || opts.fsChecker.rewrites.fallback.length > 0;
|
148
148
|
const hotReloaderSpan = (0, _trace.trace)('hot-reloader', undefined, {
|
149
|
-
version: "15.6.0-canary.
|
149
|
+
version: "15.6.0-canary.4"
|
150
150
|
});
|
151
151
|
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
|
152
152
|
// of the current `next dev` invocation.
|
@@ -226,7 +226,7 @@ class HotReloaderWebpack {
|
|
226
226
|
this.previewProps = previewProps;
|
227
227
|
this.rewrites = rewrites;
|
228
228
|
this.hotReloaderSpan = (0, _trace.trace)('hot-reloader', undefined, {
|
229
|
-
version: "15.6.0-canary.
|
229
|
+
version: "15.6.0-canary.4"
|
230
230
|
});
|
231
231
|
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
|
232
232
|
// of the current `next dev` invocation.
|
@@ -82,7 +82,7 @@ function logStartInfo({ networkUrl, appUrl, envInfo, experimentalFeatures, logBu
|
|
82
82
|
bundlerSuffix = ' (webpack)';
|
83
83
|
}
|
84
84
|
}
|
85
|
-
_log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"15.6.0-canary.
|
85
|
+
_log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"15.6.0-canary.4"}`))}${bundlerSuffix}`);
|
86
86
|
if (appUrl) {
|
87
87
|
_log.bootstrap(`- Local: ${appUrl}`);
|
88
88
|
}
|
@@ -179,7 +179,7 @@ async function getRequestHandlers({ dir, port, isDev, onDevServerCleanup, server
|
|
179
179
|
async function startServer(serverOptions) {
|
180
180
|
const { dir, isDev, hostname, minimalMode, allowRetry, keepAliveTimeout, selfSignedCertificate } = serverOptions;
|
181
181
|
let { port } = serverOptions;
|
182
|
-
process.title = `next-server (v${"15.6.0-canary.
|
182
|
+
process.title = `next-server (v${"15.6.0-canary.4"})`;
|
183
183
|
let handlersReady = ()=>{};
|
184
184
|
let handlersError = ()=>{};
|
185
185
|
let handlersPromise = new Promise((resolve, reject)=>{
|
@@ -22,7 +22,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
22
22
|
value: true
|
23
23
|
});
|
24
24
|
const _workunitasyncstorageexternal = require("../app-render/work-unit-async-storage.external");
|
25
|
-
const MODE = process.env.
|
25
|
+
const MODE = process.env.NEXT_USE_UNHANDLED_REJECTION_FILTER;
|
26
26
|
let ENABLE_UHR_FILTER = false;
|
27
27
|
let DEBUG_UHR_FILTER = false;
|
28
28
|
switch(MODE){
|
@@ -42,7 +42,7 @@ switch(MODE){
|
|
42
42
|
break;
|
43
43
|
default:
|
44
44
|
if (typeof MODE === 'string') {
|
45
|
-
console.error(`
|
45
|
+
console.error(`NEXT_USE_UNHANDLED_REJECTION_FILTER has an unrecognized value: ${JSON.stringify(MODE)}. Use "enabled", "disabled", or "debug" or omit the environment variable altogether`);
|
46
46
|
}
|
47
47
|
}
|
48
48
|
const debug = DEBUG_UHR_FILTER ? (...args)=>console.log('[UNHANDLED REJECTION DEBUG]', ...args, new Error().stack) : undefined;
|