next 16.0.1-canary.1 → 16.0.1-canary.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/bin/next +1 -1
  2. package/dist/build/index.js +3 -3
  3. package/dist/build/static-paths/app.d.ts +13 -12
  4. package/dist/build/static-paths/app.js +121 -57
  5. package/dist/build/static-paths/app.js.map +1 -1
  6. package/dist/build/swc/index.js +1 -1
  7. package/dist/build/webpack-config.js +2 -2
  8. package/dist/client/app-bootstrap.js +1 -1
  9. package/dist/client/index.js +1 -1
  10. package/dist/compiled/next-server/pages-api-turbo.runtime.prod.js +1 -1
  11. package/dist/compiled/next-server/pages-api-turbo.runtime.prod.js.map +1 -1
  12. package/dist/compiled/next-server/pages-turbo.runtime.prod.js +1 -1
  13. package/dist/compiled/next-server/pages-turbo.runtime.prod.js.map +1 -1
  14. package/dist/esm/build/index.js +3 -3
  15. package/dist/esm/build/static-paths/app.js +131 -64
  16. package/dist/esm/build/static-paths/app.js.map +1 -1
  17. package/dist/esm/build/swc/index.js +1 -1
  18. package/dist/esm/build/webpack-config.js +2 -2
  19. package/dist/esm/client/app-bootstrap.js +1 -1
  20. package/dist/esm/client/index.js +1 -1
  21. package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
  22. package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
  23. package/dist/esm/server/lib/app-info-log.js +1 -1
  24. package/dist/esm/server/lib/start-server.js +1 -1
  25. package/dist/esm/shared/lib/errors/canary-only-config-error.js +1 -1
  26. package/dist/server/dev/hot-reloader-turbopack.js +1 -1
  27. package/dist/server/dev/hot-reloader-webpack.js +1 -1
  28. package/dist/server/lib/app-info-log.js +1 -1
  29. package/dist/server/lib/start-server.js +1 -1
  30. package/dist/shared/lib/errors/canary-only-config-error.js +1 -1
  31. package/dist/telemetry/anonymous-meta.js +1 -1
  32. package/dist/telemetry/events/session-stopped.js +2 -2
  33. package/dist/telemetry/events/version.js +2 -2
  34. package/package.json +15 -15
@@ -307,7 +307,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
307
307
  try {
308
308
  const nextBuildSpan = trace('next-build', undefined, {
309
309
  buildMode: experimentalBuildMode,
310
- version: "16.0.1-canary.1"
310
+ version: "16.0.1-canary.2"
311
311
  });
312
312
  NextBuildContext.nextBuildSpan = nextBuildSpan;
313
313
  NextBuildContext.dir = dir;
@@ -828,7 +828,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
828
828
  // Files outside of the distDir can be "type": "module"
829
829
  await writeFileUtf8(path.join(distDir, 'package.json'), '{"type": "commonjs"}');
830
830
  // These are written to distDir, so they need to come after creating and cleaning distDr.
831
- await recordFrameworkVersion("16.0.1-canary.1");
831
+ await recordFrameworkVersion("16.0.1-canary.2");
832
832
  await updateBuildDiagnostics({
833
833
  buildStage: 'start'
834
834
  });
@@ -2505,7 +2505,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
2505
2505
  configOutDir: path.join(dir, configOutDir),
2506
2506
  staticPages,
2507
2507
  serverPropsPages,
2508
- nextVersion: "16.0.1-canary.1",
2508
+ nextVersion: "16.0.1-canary.2",
2509
2509
  tracingRoot: outputFileTracingRoot,
2510
2510
  hasNodeMiddleware,
2511
2511
  hasInstrumentationHook,
@@ -6,7 +6,9 @@ import { normalizePathname, encodeParam, createFallbackRouteParam } from './util
6
6
  import escapePathDelimiters from '../../shared/lib/router/utils/escape-path-delimiters';
7
7
  import { createIncrementalCache } from '../../export/helpers/create-incremental-cache';
8
8
  import { InvariantError } from '../../shared/lib/invariant-error';
9
- import { getParamProperties } from '../../shared/lib/router/utils/get-segment-param';
9
+ import { getParamProperties, getSegmentParam } from '../../shared/lib/router/utils/get-segment-param';
10
+ import { parseLoaderTree } from '../../shared/lib/router/utils/parse-loader-tree';
11
+ import { INTERCEPTION_ROUTE_MARKERS } from '../../shared/lib/router/utils/interception-routes';
10
12
  import { throwEmptyGenerateStaticParamsError } from '../../shared/lib/errors/empty-generate-static-params-error';
11
13
  /**
12
14
  * Filters out duplicate parameters from a list of parameters.
@@ -426,64 +428,131 @@ import { throwEmptyGenerateStaticParamsError } from '../../shared/lib/errors/emp
426
428
  }
427
429
  }
428
430
  /**
429
- * Resolves parallel route parameters from regular route parameters. This function
430
- * handles the complex logic of determining how to populate parallel route params
431
- * based on their type (catchall, optional-catchall, or regular) and the current
432
- * state of fallback parameters.
431
+ * Resolves parallel route parameters from the loader tree. This function uses
432
+ * tree-based traversal to correctly handle the hierarchical structure of parallel
433
+ * routes and accurately determine parameter values based on their depth in the tree.
433
434
  *
434
- * @param parallelRouteSegments - Array of parallel route segments with their types and param names
435
+ * Unlike interpolateParallelRouteParams (which has a complete URL at runtime),
436
+ * this build-time function determines which parallel route params are unknown.
437
+ * The pathname may contain placeholders like [slug], making it incomplete.
438
+ *
439
+ * @param loaderTree - The loader tree structure containing route hierarchy
435
440
  * @param params - The current route parameters object (will be mutated)
436
- * @param pathname - The current pathname being processed
441
+ * @param pathname - The current pathname being processed (may contain placeholders)
437
442
  * @param fallbackRouteParams - Array of fallback route parameters (will be mutated)
438
- */ export function resolveParallelRouteParams(parallelRouteSegments, params, pathname, fallbackRouteParams) {
439
- // Resolve parallel route params from the regular route params
440
- for (const { paramType, paramName } of parallelRouteSegments){
441
- // Check if we can resolve this from existing params
442
- if (params[paramName]) {
443
- continue;
443
+ */ export function resolveParallelRouteParams(loaderTree, params, pathname, fallbackRouteParams) {
444
+ // Stack-based traversal with depth and parallel route key tracking
445
+ const stack = [
446
+ {
447
+ tree: loaderTree,
448
+ depth: 0,
449
+ parallelKey: 'children'
444
450
  }
445
- if (paramType === 'catchall' || paramType === 'optional-catchall') {
446
- // If there are any fallback route segments then we can't use the
447
- // pathname to derive the value because it's not complete. We can
448
- // make this assumption because the routes are always resolved left
449
- // to right and the catchall is always the last segment, so any
450
- // route parameters that are unknown will always contribute to the
451
- // pathname and therefore the catchall param too.
452
- if (fallbackRouteParams.some((param)=>!param.isParallelRouteParam)) {
453
- fallbackRouteParams.push(createFallbackRouteParam(paramName, paramType, true));
454
- continue;
455
- }
456
- // For catchall routes in parallel segments, derive from pathname
457
- // Similar to getDynamicParam's pagePath parsing logic
458
- const pathSegments = pathname.split('/').filter(Boolean);
459
- // For catchall parallel routes, we use the full path segments
460
- // This mimics the behavior in getDynamicParam where the pagePath
461
- // is split and used to populate catchall values
462
- if (pathSegments.length > 0) {
463
- // FIXME: (NAR-335) this should handle prefixed segments
464
- params[paramName] = pathSegments;
465
- } else if (paramType === 'optional-catchall') {
466
- params[paramName] = [];
467
- } else {
468
- // We shouldn't be able to match a catchall segment without any path
469
- // segments if it's not an optional catchall.
470
- throw Object.defineProperty(new InvariantError(`Unexpected empty path segments match for a pathname "${pathname}" with param "${paramName}" of type "${paramType}"`), "__NEXT_ERROR_CODE", {
471
- value: "E792",
472
- enumerable: false,
473
- configurable: true
474
- });
451
+ ];
452
+ // Parse pathname into segments for depth-based resolution
453
+ const pathSegments = pathname.split('/').filter(Boolean);
454
+ while(stack.length > 0){
455
+ const { tree, depth, parallelKey } = stack.pop();
456
+ const { segment, parallelRoutes } = parseLoaderTree(tree);
457
+ // Only process segments that are in parallel routes (not the main 'children' route)
458
+ if (parallelKey !== 'children') {
459
+ const segmentParam = getSegmentParam(segment);
460
+ if (segmentParam && !params.hasOwnProperty(segmentParam.param)) {
461
+ const { param: paramName, type: paramType } = segmentParam;
462
+ switch(paramType){
463
+ case 'catchall':
464
+ case 'optional-catchall':
465
+ case 'catchall-intercepted':
466
+ // If there are any non-parallel fallback route segments, we can't use the
467
+ // pathname to derive the value because it's not complete. We can make
468
+ // this assumption because routes are resolved left to right.
469
+ if (fallbackRouteParams.some((param)=>!param.isParallelRouteParam)) {
470
+ fallbackRouteParams.push(createFallbackRouteParam(paramName, paramType, true));
471
+ break;
472
+ }
473
+ // For catchall routes in parallel segments, derive from pathname
474
+ // using depth to determine which segments to use
475
+ const remainingSegments = pathSegments.slice(depth);
476
+ // Process segments to handle any embedded dynamic params
477
+ // Track if we encounter any unknown param placeholders
478
+ let hasUnknownParam = false;
479
+ const processedSegments = remainingSegments.flatMap((pathSegment)=>{
480
+ const param = getSegmentParam(pathSegment);
481
+ if (param) {
482
+ // If the segment is a param placeholder, check if we have its value
483
+ if (!params.hasOwnProperty(param.param)) {
484
+ // Unknown param placeholder in pathname - can't derive full value
485
+ hasUnknownParam = true;
486
+ return undefined;
487
+ }
488
+ // If the segment matches a param, return the param value
489
+ // We don't encode values here as that's handled during retrieval.
490
+ return params[param.param];
491
+ }
492
+ // Otherwise it's a static segment
493
+ return pathSegment;
494
+ }).filter((s)=>s !== undefined);
495
+ // If we encountered any unknown param placeholders, we can't derive
496
+ // the full catch-all value from the pathname, so mark as fallback.
497
+ if (hasUnknownParam) {
498
+ fallbackRouteParams.push(createFallbackRouteParam(paramName, paramType, true));
499
+ break;
500
+ }
501
+ if (processedSegments.length > 0) {
502
+ params[paramName] = processedSegments;
503
+ } else if (paramType === 'optional-catchall') {
504
+ params[paramName] = [];
505
+ } else {
506
+ // We shouldn't be able to match a catchall segment without any path
507
+ // segments if it's not an optional catchall
508
+ throw Object.defineProperty(new InvariantError(`Unexpected empty path segments match for a pathname "${pathname}" with param "${paramName}" of type "${paramType}"`), "__NEXT_ERROR_CODE", {
509
+ value: "E792",
510
+ enumerable: false,
511
+ configurable: true
512
+ });
513
+ }
514
+ break;
515
+ case 'dynamic':
516
+ case 'dynamic-intercepted':
517
+ // For regular dynamic parameters, take the segment at this depth
518
+ if (depth < pathSegments.length) {
519
+ const pathSegment = pathSegments[depth];
520
+ const param = getSegmentParam(pathSegment);
521
+ // Check if the segment at this depth is a placeholder for an unknown param
522
+ if (param && !params.hasOwnProperty(param.param)) {
523
+ // The segment is a placeholder like [category] and we don't have the value
524
+ fallbackRouteParams.push(createFallbackRouteParam(paramName, paramType, true));
525
+ break;
526
+ }
527
+ // If the segment matches a param, use the param value from params object
528
+ // Otherwise it's a static segment, just use it directly
529
+ // We don't encode values here as that's handled during retrieval
530
+ params[paramName] = param ? params[param.param] : pathSegment;
531
+ } else {
532
+ // No segment at this depth, mark as fallback.
533
+ fallbackRouteParams.push(createFallbackRouteParam(paramName, paramType, true));
534
+ }
535
+ break;
536
+ default:
537
+ paramType;
538
+ }
475
539
  }
476
- } else if (paramType === 'dynamic') {
477
- // We can't resolve dynamic param values at build time because they're
478
- // inferred from the request pathname.
479
- fallbackRouteParams.push(createFallbackRouteParam(paramName, paramType, true));
480
- } else {
481
- // This is some other type of route param that shouldn't get resolved
482
- // statically.
483
- throw Object.defineProperty(new InvariantError(`Unexpected match for a pathname "${pathname}" with a param "${paramName}" of type "${paramType}"`), "__NEXT_ERROR_CODE", {
484
- value: "E791",
485
- enumerable: false,
486
- configurable: true
540
+ }
541
+ // Calculate next depth - increment if this is not a route group and not empty
542
+ let nextDepth = depth;
543
+ // Route groups are like (marketing) or (dashboard), NOT interception routes like (.)photo
544
+ // Interception routes start with markers like (.), (..), (...), (..)(..)) and should increment depth
545
+ const isInterceptionRoute = INTERCEPTION_ROUTE_MARKERS.some((marker)=>segment.startsWith(marker));
546
+ const isRouteGroup = !isInterceptionRoute && segment.startsWith('(') && segment.endsWith(')');
547
+ if (!isRouteGroup && segment !== '') {
548
+ nextDepth++;
549
+ }
550
+ // Add all parallel routes to the stack for processing.
551
+ for (const [key, route] of Object.entries(parallelRoutes)){
552
+ stack.push({
553
+ tree: route,
554
+ depth: nextDepth,
555
+ parallelKey: key
487
556
  });
488
557
  }
489
558
  }
@@ -597,7 +666,6 @@ import { throwEmptyGenerateStaticParamsError } from '../../shared/lib/errors/emp
597
666
  cacheMaxMemorySize
598
667
  });
599
668
  const childrenRouteParamSegments = [];
600
- const parallelRouteSegments = [];
601
669
  // These are all the parallel fallback route params that will be included when
602
670
  // we're emitting the route for the base route.
603
671
  const parallelFallbackRouteParams = [];
@@ -621,13 +689,9 @@ import { throwEmptyGenerateStaticParamsError } from '../../shared/lib/errors/emp
621
689
  if (nonParallelParamNames.has(segment.paramName)) {
622
690
  continue;
623
691
  }
624
- // Collect all the parallel route segments that have dynamic params for
625
- // second-pass resolution.
626
- parallelRouteSegments.push({
627
- name: segment.name,
628
- paramName: segment.paramName,
629
- paramType: segment.paramType
630
- });
692
+ // Collect parallel fallback route params for the base route.
693
+ // The actual parallel route param resolution is now handled by
694
+ // resolveParallelRouteParams using the loader tree.
631
695
  parallelFallbackRouteParams.push(createFallbackRouteParam(segment.paramName, segment.paramType, true));
632
696
  } else {
633
697
  // Collect all the route param keys that are not parallel route params.
@@ -757,8 +821,11 @@ import { throwEmptyGenerateStaticParamsError } from '../../shared/lib/errors/emp
757
821
  pathname = pathname.replace(segment.name, encodeParam(paramValue, (value)=>escapePathDelimiters(value, true)));
758
822
  encodedPathname = encodedPathname.replace(segment.name, encodeParam(paramValue, encodeURIComponent));
759
823
  }
760
- // Resolve parallel route params from the regular route params
761
- resolveParallelRouteParams(parallelRouteSegments, params, pathname, fallbackRouteParams);
824
+ // Resolve parallel route params from the loader tree if this is from an
825
+ // app page.
826
+ if ('loaderTree' in ComponentMod.routeModule.userland && Array.isArray(ComponentMod.routeModule.userland.loaderTree)) {
827
+ resolveParallelRouteParams(ComponentMod.routeModule.userland.loaderTree, params, pathname, fallbackRouteParams);
828
+ }
762
829
  const fallbackRootParams = [];
763
830
  for (const { paramName, isParallelRouteParam } of fallbackRouteParams){
764
831
  // Only add the param to the fallback root params if it's not a
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/build/static-paths/app.ts"],"sourcesContent":["import type { Params } from '../../server/request/params'\nimport type { AppPageModule } from '../../server/route-modules/app-page/module'\nimport type { AppSegment } from '../segment-config/app/app-segments'\nimport type {\n FallbackRouteParam,\n PrerenderedRoute,\n StaticPathsResult,\n} from './types'\n\nimport path from 'node:path'\nimport { AfterRunner } from '../../server/after/run-with-after'\nimport { createWorkStore } from '../../server/async-storage/work-store'\nimport { FallbackMode } from '../../lib/fallback'\nimport type { IncrementalCache } from '../../server/lib/incremental-cache'\nimport {\n normalizePathname,\n encodeParam,\n createFallbackRouteParam,\n} from './utils'\nimport escapePathDelimiters from '../../shared/lib/router/utils/escape-path-delimiters'\nimport { createIncrementalCache } from '../../export/helpers/create-incremental-cache'\nimport type { NextConfigComplete } from '../../server/config-shared'\nimport type { WorkStore } from '../../server/app-render/work-async-storage.external'\nimport type { DynamicParamTypes } from '../../shared/lib/app-router-types'\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport { getParamProperties } from '../../shared/lib/router/utils/get-segment-param'\nimport { throwEmptyGenerateStaticParamsError } from '../../shared/lib/errors/empty-generate-static-params-error'\n\n/**\n * Filters out duplicate parameters from a list of parameters.\n * This function uses a Map to efficiently store and retrieve unique parameter combinations.\n *\n * @param childrenRouteParams - The keys of the parameters. These should be sorted to ensure consistent key generation.\n * @param routeParams - The list of parameter objects to filter.\n * @returns A new array containing only the unique parameter combinations.\n */\nexport function filterUniqueParams(\n childrenRouteParams: readonly { paramName: string }[],\n routeParams: readonly Params[]\n): Params[] {\n // A Map is used to store unique parameter combinations. The key of the Map\n // is a string representation of the parameter combination, and the value\n // is the actual `Params` object.\n const unique = new Map<string, Params>()\n\n // Iterate over each parameter object in the input array.\n for (const params of routeParams) {\n let key = '' // Initialize an empty string to build the unique key for the current `params` object.\n\n // Iterate through the `routeParamKeys` (which are assumed to be sorted).\n // This consistent order is crucial for generating a stable and unique key\n // for each parameter combination.\n for (const { paramName: paramKey } of childrenRouteParams) {\n const value = params[paramKey]\n\n // Construct a part of the key using the parameter key and its value.\n // A type prefix (`A:` for Array, `S:` for String, `U:` for undefined) is added to the value\n // to prevent collisions. For example, `['a', 'b']` and `'a,b'` would\n // otherwise generate the same string representation, leading to incorrect\n // deduplication. This ensures that different types with the same string\n // representation are treated as distinct.\n let valuePart: string\n if (Array.isArray(value)) {\n valuePart = `A:${value.join(',')}`\n } else if (value === undefined) {\n valuePart = `U:undefined`\n } else {\n valuePart = `S:${value}`\n }\n key += `${paramKey}:${valuePart}|`\n }\n\n // If the generated key is not already in the `unique` Map, it means this\n // parameter combination is unique so far. Add it to the Map.\n if (!unique.has(key)) {\n unique.set(key, params)\n }\n }\n\n // Convert the Map's values (the unique `Params` objects) back into an array\n // and return it.\n return Array.from(unique.values())\n}\n\n/**\n * Generates all unique sub-combinations of Route Parameters from a list of Static Parameters.\n * This function creates all possible prefixes of the Route Parameters, which is\n * useful for generating Static Shells that can serve as Fallback Shells for more specific Route Shells.\n *\n * When Root Parameters are provided, the function ensures that Static Shells only\n * include complete sets of Root Parameters. This prevents generating invalid Static Shells\n * that are missing required Root Parameters.\n *\n * Example with Root Parameters ('lang', 'region') and Route Parameters ('lang', 'region', 'slug'):\n *\n * Given the following Static Parameters:\n * ```\n * [\n * { lang: 'en', region: 'US', slug: ['home'] },\n * { lang: 'en', region: 'US', slug: ['about'] },\n * { lang: 'fr', region: 'CA', slug: ['about'] },\n * ]\n * ```\n *\n * The result will be:\n * ```\n * [\n * { lang: 'en', region: 'US' }, // Complete Root Parameters\n * { lang: 'en', region: 'US', slug: ['home'] },\n * { lang: 'en', region: 'US', slug: ['about'] },\n * { lang: 'fr', region: 'CA' }, // Complete Root Parameters\n * { lang: 'fr', region: 'CA', slug: ['about'] },\n * ]\n * ```\n *\n * Note that partial combinations like `{ lang: 'en' }` are NOT generated because\n * they don't include the complete set of Root Parameters.\n *\n * For routes without Root Parameters (e.g., `/[slug]`), all sub-combinations are generated\n * as before.\n *\n * @param childrenRouteParams - The children route params. These should be sorted\n * to ensure consistent key generation for the internal Map.\n * @param routeParams - The list of Static Parameters to filter.\n * @param rootParamKeys - The keys of the Root Parameters. When provided, ensures Static Shells\n * include all Root Parameters.\n * @returns A new array containing all unique sub-combinations of Route Parameters.\n */\nexport function generateAllParamCombinations(\n childrenRouteParams: ReadonlyArray<{\n readonly paramName: string\n }>,\n routeParams: readonly Params[],\n rootParamKeys: readonly string[]\n): Params[] {\n // A Map is used to store unique combinations of Route Parameters.\n // The key of the Map is a string representation of the Route Parameter\n // combination, and the value is the `Params` object containing only\n // the Route Parameters.\n const combinations = new Map<string, Params>()\n\n // Determine the minimum index where all Root Parameters are included.\n // This optimization ensures we only generate combinations that include\n // a complete set of Root Parameters, preventing invalid Static Shells.\n //\n // For example, if rootParamKeys = ['lang', 'region'] and routeParamKeys = ['lang', 'region', 'slug']:\n // - 'lang' is at index 0, 'region' is at index 1\n // - minIndexForCompleteRootParams = max(0, 1) = 1\n // - We'll only generate combinations starting from index 1 (which includes both lang and region)\n let minIndexForCompleteRootParams = -1\n if (rootParamKeys.length > 0) {\n // Find the index of the last Root Parameter in routeParamKeys.\n // This tells us the minimum combination length needed to include all Root Parameters.\n for (const rootParamKey of rootParamKeys) {\n const index = childrenRouteParams.findIndex(\n (param) => param.paramName === rootParamKey\n )\n if (index === -1) {\n // Root Parameter not found in Route Parameters - this shouldn't happen in normal cases\n // but we handle it gracefully by treating it as if there are no Root Parameters.\n // This allows the function to fall back to generating all sub-combinations.\n minIndexForCompleteRootParams = -1\n break\n }\n // Track the highest index among all Root Parameters.\n // This ensures all Root Parameters are included in any generated combination.\n minIndexForCompleteRootParams = Math.max(\n minIndexForCompleteRootParams,\n index\n )\n }\n }\n\n // Iterate over each Static Parameter object in the input array.\n // Each params object represents one potential route combination (e.g., { lang: 'en', region: 'US', slug: 'home' })\n for (const params of routeParams) {\n // Generate all possible prefix combinations for this Static Parameter set.\n // For routeParamKeys = ['lang', 'region', 'slug'], we'll generate combinations at:\n // - i=0: { lang: 'en' }\n // - i=1: { lang: 'en', region: 'US' }\n // - i=2: { lang: 'en', region: 'US', slug: 'home' }\n //\n // The iteration order is crucial for generating stable and unique keys\n // for each Route Parameter combination.\n for (let i = 0; i < childrenRouteParams.length; i++) {\n // Skip generating combinations that don't include all Root Parameters.\n // This prevents creating invalid Static Shells that are missing required Root Parameters.\n //\n // For example, if Root Parameters are ['lang', 'region'] and minIndexForCompleteRootParams = 1:\n // - Skip i=0 (would only include 'lang', missing 'region')\n // - Process i=1 and higher (includes both 'lang' and 'region')\n if (\n minIndexForCompleteRootParams >= 0 &&\n i < minIndexForCompleteRootParams\n ) {\n continue\n }\n\n // Initialize data structures for building this specific combination\n const combination: Params = {}\n const keyParts: string[] = []\n let hasAllRootParams = true\n\n // Build the sub-combination with parameters from index 0 to i (inclusive).\n // This creates a prefix of the full parameter set, building up combinations incrementally.\n //\n // For example, if routeParamKeys = ['lang', 'region', 'slug'] and i = 1:\n // - j=0: Add 'lang' parameter\n // - j=1: Add 'region' parameter\n // Result: { lang: 'en', region: 'US' }\n for (let j = 0; j <= i; j++) {\n const { paramName: routeKey } = childrenRouteParams[j]\n\n // Check if the parameter exists in the original params object and has a defined value.\n // This handles cases where generateStaticParams doesn't provide all possible parameters,\n // or where some parameters are optional/undefined.\n if (\n !params.hasOwnProperty(routeKey) ||\n params[routeKey] === undefined\n ) {\n // If this missing parameter is a Root Parameter, mark the combination as invalid.\n // Root Parameters are required for Static Shells, so we can't generate partial combinations without them.\n if (rootParamKeys.includes(routeKey)) {\n hasAllRootParams = false\n }\n // Stop building this combination since we've hit a missing parameter.\n // This ensures we only generate valid prefix combinations with consecutive parameters.\n break\n }\n\n const value = params[routeKey]\n combination[routeKey] = value\n\n // Construct a unique key part for this parameter to enable deduplication.\n // We use type prefixes to prevent collisions between different value types\n // that might have the same string representation.\n //\n // Examples:\n // - Array ['foo', 'bar'] becomes \"A:foo,bar\"\n // - String \"foo,bar\" becomes \"S:foo,bar\"\n // - This prevents collisions between ['foo', 'bar'] and \"foo,bar\"\n let valuePart: string\n if (Array.isArray(value)) {\n valuePart = `A:${value.join(',')}`\n } else {\n valuePart = `S:${value}`\n }\n keyParts.push(`${routeKey}:${valuePart}`)\n }\n\n // Build the final unique key by joining all parameter parts.\n // This key is used for deduplication in the combinations Map.\n // Format: \"lang:S:en|region:S:US|slug:A:home,about\"\n const currentKey = keyParts.join('|')\n\n // Only add the combination if it meets our criteria:\n // 1. hasAllRootParams: Contains all required Root Parameters\n // 2. !combinations.has(currentKey): Is not a duplicate of an existing combination\n //\n // This ensures we only generate valid, unique parameter combinations for Static Shells.\n if (hasAllRootParams && !combinations.has(currentKey)) {\n combinations.set(currentKey, combination)\n }\n }\n }\n\n // Convert the Map's values back into an array and return the final result.\n // The Map ensures all combinations are unique, and we return only the\n // parameter objects themselves, discarding the internal deduplication keys.\n return Array.from(combinations.values())\n}\n\n/**\n * Calculates the fallback mode based on the given parameters.\n *\n * @param dynamicParams - Whether dynamic params are enabled.\n * @param fallbackRootParams - The root params that are part of the fallback.\n * @param baseFallbackMode - The base fallback mode to use.\n * @returns The calculated fallback mode.\n */\nexport function calculateFallbackMode(\n dynamicParams: boolean,\n fallbackRootParams: readonly string[],\n baseFallbackMode: FallbackMode | undefined\n): FallbackMode {\n return dynamicParams\n ? // If the fallback params includes any root params, then we need to\n // perform a blocking static render.\n fallbackRootParams.length > 0\n ? FallbackMode.BLOCKING_STATIC_RENDER\n : (baseFallbackMode ?? FallbackMode.NOT_FOUND)\n : FallbackMode.NOT_FOUND\n}\n\n/**\n * Validates the parameters to ensure they're accessible and have the correct\n * types.\n *\n * @param page - The page to validate.\n * @param regex - The route regex.\n * @param isRoutePPREnabled - Whether the route has partial prerendering enabled.\n * @param childrenRouteParamSegments - The keys of the parameters.\n * @param rootParamKeys - The keys of the root params.\n * @param routeParams - The list of parameters to validate.\n * @returns The list of validated parameters.\n */\nfunction validateParams(\n page: string,\n isRoutePPREnabled: boolean,\n childrenRouteParamSegments: ReadonlyArray<{\n readonly paramName: string\n readonly paramType: DynamicParamTypes\n }>,\n rootParamKeys: readonly string[],\n routeParams: readonly Params[]\n): Params[] {\n const valid: Params[] = []\n\n // Validate that if there are any root params, that the user has provided at\n // least one value for them only if we're using partial prerendering.\n if (isRoutePPREnabled && rootParamKeys.length > 0) {\n if (\n routeParams.length === 0 ||\n rootParamKeys.some((key) =>\n routeParams.some((params) => !(key in params))\n )\n ) {\n if (rootParamKeys.length === 1) {\n throw new Error(\n `A required root parameter (${rootParamKeys[0]}) was not provided in generateStaticParams for ${page}, please provide at least one value.`\n )\n }\n\n throw new Error(\n `Required root params (${rootParamKeys.join(', ')}) were not provided in generateStaticParams for ${page}, please provide at least one value for each.`\n )\n }\n }\n\n for (const params of routeParams) {\n const item: Params = {}\n\n for (const { paramName: key, paramType } of childrenRouteParamSegments) {\n const { repeat, optional } = getParamProperties(paramType)\n\n let paramValue = params[key]\n\n if (\n optional &&\n params.hasOwnProperty(key) &&\n (paramValue === null ||\n paramValue === undefined ||\n (paramValue as any) === false)\n ) {\n paramValue = []\n }\n\n // A parameter is missing, so the rest of the params are not accessible.\n // We only support this when the route has partial prerendering enabled.\n // This will make it so that the remaining params are marked as missing so\n // we can generate a fallback route for them.\n if (!paramValue && isRoutePPREnabled) {\n break\n }\n\n // Perform validation for the parameter based on whether it's a repeat\n // parameter or not.\n if (repeat) {\n if (!Array.isArray(paramValue)) {\n throw new Error(\n `A required parameter (${key}) was not provided as an array received ${typeof paramValue} in generateStaticParams for ${page}`\n )\n }\n } else {\n if (typeof paramValue !== 'string') {\n throw new Error(\n `A required parameter (${key}) was not provided as a string received ${typeof paramValue} in generateStaticParams for ${page}`\n )\n }\n }\n\n item[key] = paramValue\n }\n\n valid.push(item)\n }\n\n return valid\n}\n\ninterface TrieNode {\n /**\n * The children of the node. Each key is a unique string representation of a parameter value,\n * and the value is the next TrieNode in the path.\n */\n children: Map<string, TrieNode>\n\n /**\n * The routes that are associated with this specific parameter combination (node).\n * These are the routes whose concrete parameters lead to this node in the Trie.\n */\n routes: PrerenderedRoute[]\n}\n\n/**\n * Assigns the throwOnEmptyStaticShell property to each of the prerendered routes.\n * This function uses a Trie data structure to efficiently determine whether each route\n * should throw an error when its static shell is empty.\n *\n * A route should not throw on empty static shell if it has child routes in the Trie. For example,\n * if we have two routes, `/blog/first-post` and `/blog/[slug]`, the route for\n * `/blog/[slug]` should not throw because `/blog/first-post` is a more specific concrete route.\n *\n * @param prerenderedRoutes - The prerendered routes.\n * @param childrenRouteParams - The keys of the route parameters.\n */\nexport function assignErrorIfEmpty(\n prerenderedRoutes: readonly PrerenderedRoute[],\n childrenRouteParams: ReadonlyArray<{\n readonly paramName: string\n }>\n): void {\n // If there are no routes to process, exit early.\n if (prerenderedRoutes.length === 0) {\n return\n }\n\n // Initialize the root of the Trie. This node represents the starting point\n // before any parameters have been considered.\n const root: TrieNode = { children: new Map(), routes: [] }\n\n // Phase 1: Build the Trie.\n // Iterate over each prerendered route and insert it into the Trie.\n // Each route's concrete parameter values form a path in the Trie.\n for (const route of prerenderedRoutes) {\n let currentNode = root // Start building the path from the root for each route.\n\n // Iterate through the sorted parameter keys. The order of keys is crucial\n // for ensuring that routes with the same concrete parameters follow the\n // same path in the Trie, regardless of the original order of properties\n // in the `params` object.\n for (const { paramName: key } of childrenRouteParams) {\n // Check if the current route actually has a concrete value for this parameter.\n // If a dynamic segment is not filled (i.e., it's a fallback), it won't have\n // this property, and we stop building the path for this route at this point.\n if (route.params.hasOwnProperty(key)) {\n const value = route.params[key]\n\n // Generate a unique key for the parameter's value. This is critical\n // to prevent collisions between different data types that might have\n // the same string representation (e.g., `['a', 'b']` vs `'a,b'`).\n // A type prefix (`A:` for Array, `S:` for String, `U:` for undefined)\n // is added to the value to prevent collisions. This ensures that\n // different types with the same string representation are treated as\n // distinct.\n let valueKey: string\n if (Array.isArray(value)) {\n valueKey = `A:${value.join(',')}`\n } else if (value === undefined) {\n valueKey = `U:undefined`\n } else {\n valueKey = `S:${value}`\n }\n\n // Look for a child node corresponding to this `valueKey` from the `currentNode`.\n let childNode = currentNode.children.get(valueKey)\n if (!childNode) {\n // If the child node doesn't exist, create a new one and add it to\n // the current node's children.\n childNode = { children: new Map(), routes: [] }\n currentNode.children.set(valueKey, childNode)\n }\n // Move deeper into the Trie to the `childNode` for the next parameter.\n currentNode = childNode\n }\n }\n // After processing all concrete parameters for the route, add the full\n // `PrerenderedRoute` object to the `routes` array of the `currentNode`.\n // This node represents the unique concrete parameter combination for this route.\n currentNode.routes.push(route)\n }\n\n // Phase 2: Traverse the Trie to assign the `throwOnEmptyStaticShell` property.\n // This is done using an iterative Depth-First Search (DFS) approach with an\n // explicit stack to avoid JavaScript's recursion depth limits (stack overflow)\n // for very deep routing structures.\n const stack: TrieNode[] = [root] // Initialize the stack with the root node.\n\n while (stack.length > 0) {\n const node = stack.pop()! // Pop the next node to process from the stack.\n\n // `hasChildren` indicates if this node has any more specific concrete\n // parameter combinations branching off from it. If true, it means this\n // node represents a prefix for other, more specific routes.\n const hasChildren = node.children.size > 0\n\n // If the current node has routes associated with it (meaning, routes whose\n // concrete parameters lead to this node's path in the Trie).\n if (node.routes.length > 0) {\n // Determine the minimum number of fallback parameters among all routes\n // that are associated with this current Trie node. This is used to\n // identify if a route should not throw on empty static shell relative to another route *at the same level*\n // of concrete parameters, but with fewer fallback parameters.\n let minFallbacks = Infinity\n for (const r of node.routes) {\n // `fallbackRouteParams?.length ?? 0` handles cases where `fallbackRouteParams`\n // might be `undefined` or `null`, treating them as 0 length.\n minFallbacks = Math.min(\n minFallbacks,\n r.fallbackRouteParams ? r.fallbackRouteParams.length : 0\n )\n }\n\n // Now, for each `PrerenderedRoute` associated with this node:\n for (const route of node.routes) {\n // A route is ok not to throw on an empty static shell (and thus\n // `throwOnEmptyStaticShell` should be `false`) if either of the\n // following conditions is met:\n // 1. `hasChildren` is true: This node has further concrete parameter children.\n // This means the current route is a parent to more specific routes (e.g.,\n // `/blog/[slug]` should not throw when concrete routes like `/blog/first-post` exist).\n // OR\n // 2. `route.fallbackRouteParams.length > minFallbacks`: This route has\n // more fallback parameters than another route at the same Trie node.\n // This implies the current route is a more general version that should not throw\n // compared to a more specific route that has fewer fallback parameters\n // (e.g., `/1234/[...slug]` should not throw relative to `/[id]/[...slug]`).\n if (\n hasChildren ||\n (route.fallbackRouteParams &&\n route.fallbackRouteParams.length > minFallbacks)\n ) {\n route.throwOnEmptyStaticShell = false // Should not throw on empty static shell.\n } else {\n route.throwOnEmptyStaticShell = true // Should throw on empty static shell.\n }\n }\n }\n\n // Add all children of the current node to the stack. This ensures that\n // the traversal continues to explore deeper paths in the Trie.\n for (const child of node.children.values()) {\n stack.push(child)\n }\n }\n}\n\n/**\n * Resolves parallel route parameters from regular route parameters. This function\n * handles the complex logic of determining how to populate parallel route params\n * based on their type (catchall, optional-catchall, or regular) and the current\n * state of fallback parameters.\n *\n * @param parallelRouteSegments - Array of parallel route segments with their types and param names\n * @param params - The current route parameters object (will be mutated)\n * @param pathname - The current pathname being processed\n * @param fallbackRouteParams - Array of fallback route parameters (will be mutated)\n */\nexport function resolveParallelRouteParams(\n parallelRouteSegments: ReadonlyArray<{\n readonly paramName: string\n readonly paramType: DynamicParamTypes\n }>,\n params: Params,\n pathname: string,\n fallbackRouteParams: FallbackRouteParam[]\n): void {\n // Resolve parallel route params from the regular route params\n for (const { paramType, paramName } of parallelRouteSegments) {\n // Check if we can resolve this from existing params\n if (params[paramName]) {\n // Direct match - the param name exists in regular params\n continue\n }\n\n if (paramType === 'catchall' || paramType === 'optional-catchall') {\n // If there are any fallback route segments then we can't use the\n // pathname to derive the value because it's not complete. We can\n // make this assumption because the routes are always resolved left\n // to right and the catchall is always the last segment, so any\n // route parameters that are unknown will always contribute to the\n // pathname and therefore the catchall param too.\n if (fallbackRouteParams.some((param) => !param.isParallelRouteParam)) {\n fallbackRouteParams.push(\n createFallbackRouteParam(paramName, paramType, true)\n )\n continue\n }\n\n // For catchall routes in parallel segments, derive from pathname\n // Similar to getDynamicParam's pagePath parsing logic\n const pathSegments = pathname.split('/').filter(Boolean)\n\n // For catchall parallel routes, we use the full path segments\n // This mimics the behavior in getDynamicParam where the pagePath\n // is split and used to populate catchall values\n if (pathSegments.length > 0) {\n // FIXME: (NAR-335) this should handle prefixed segments\n params[paramName] = pathSegments\n } else if (paramType === 'optional-catchall') {\n params[paramName] = []\n } else {\n // We shouldn't be able to match a catchall segment without any path\n // segments if it's not an optional catchall.\n throw new InvariantError(\n `Unexpected empty path segments match for a pathname \"${pathname}\" with param \"${paramName}\" of type \"${paramType}\"`\n )\n }\n } else if (paramType === 'dynamic') {\n // We can't resolve dynamic param values at build time because they're\n // inferred from the request pathname.\n fallbackRouteParams.push(\n createFallbackRouteParam(paramName, paramType, true)\n )\n } else {\n // This is some other type of route param that shouldn't get resolved\n // statically.\n throw new InvariantError(\n `Unexpected match for a pathname \"${pathname}\" with a param \"${paramName}\" of type \"${paramType}\"`\n )\n }\n }\n}\n\n/**\n * Processes app directory segments to build route parameters from generateStaticParams functions.\n * This function walks through the segments array and calls generateStaticParams for each segment that has it,\n * combining parent parameters with child parameters to build the complete parameter combinations.\n * Uses iterative processing instead of recursion for better performance.\n *\n * @param segments - Array of app directory segments to process\n * @param store - Work store for tracking fetch cache configuration\n * @returns Promise that resolves to an array of all parameter combinations\n */\nexport async function generateRouteStaticParams(\n segments: ReadonlyArray<\n Readonly<Pick<AppSegment, 'config' | 'generateStaticParams'>>\n >,\n store: Pick<WorkStore, 'fetchCache'>,\n isRoutePPREnabled: boolean\n): Promise<Params[]> {\n // Early return if no segments to process\n if (segments.length === 0) return []\n\n // Use iterative processing with a work queue to avoid recursion overhead\n interface WorkItem {\n segmentIndex: number\n params: Params[]\n }\n\n const queue: WorkItem[] = [{ segmentIndex: 0, params: [] }]\n let currentParams: Params[] = []\n\n while (queue.length > 0) {\n const { segmentIndex, params } = queue.shift()!\n\n // If we've processed all segments, this is our final result\n if (segmentIndex >= segments.length) {\n currentParams = params\n break\n }\n\n const current = segments[segmentIndex]\n\n // Skip segments without generateStaticParams and continue to next\n if (typeof current.generateStaticParams !== 'function') {\n queue.push({ segmentIndex: segmentIndex + 1, params })\n continue\n }\n\n // Configure fetchCache if specified\n if (current.config?.fetchCache !== undefined) {\n store.fetchCache = current.config.fetchCache\n }\n\n const nextParams: Params[] = []\n\n // If there are parent params, we need to process them.\n if (params.length > 0) {\n // Process each parent parameter combination\n for (const parentParams of params) {\n const result = await current.generateStaticParams({\n params: parentParams,\n })\n\n if (result.length > 0) {\n // Merge parent params with each result item\n for (const item of result) {\n nextParams.push({ ...parentParams, ...item })\n }\n } else if (isRoutePPREnabled) {\n throwEmptyGenerateStaticParamsError()\n } else {\n // No results, just pass through parent params\n nextParams.push(parentParams)\n }\n }\n } else {\n // No parent params, call generateStaticParams with empty object\n const result = await current.generateStaticParams({ params: {} })\n if (result.length === 0 && isRoutePPREnabled) {\n throwEmptyGenerateStaticParamsError()\n }\n\n nextParams.push(...result)\n }\n\n // Add next segment to work queue\n queue.push({ segmentIndex: segmentIndex + 1, params: nextParams })\n }\n\n return currentParams\n}\n\n/**\n * Builds the static paths for an app using `generateStaticParams`.\n *\n * @param params - The parameters for the build.\n * @returns The static paths.\n */\nexport async function buildAppStaticPaths({\n dir,\n page,\n distDir,\n cacheComponents,\n authInterrupts,\n segments,\n isrFlushToDisk,\n cacheHandler,\n cacheLifeProfiles,\n requestHeaders,\n cacheHandlers,\n cacheMaxMemorySize,\n fetchCacheKeyPrefix,\n nextConfigOutput,\n ComponentMod,\n isRoutePPREnabled = false,\n buildId,\n rootParamKeys,\n}: {\n dir: string\n page: string\n cacheComponents: boolean\n authInterrupts: boolean\n segments: readonly Readonly<AppSegment>[]\n distDir: string\n isrFlushToDisk?: boolean\n fetchCacheKeyPrefix?: string\n cacheHandler?: string\n cacheHandlers?: NextConfigComplete['cacheHandlers']\n cacheLifeProfiles?: {\n [profile: string]: import('../../server/use-cache/cache-life').CacheLife\n }\n cacheMaxMemorySize: number\n requestHeaders: IncrementalCache['requestHeaders']\n nextConfigOutput: 'standalone' | 'export' | undefined\n ComponentMod: AppPageModule\n isRoutePPREnabled: boolean\n buildId: string\n rootParamKeys: readonly string[]\n}): Promise<StaticPathsResult> {\n if (\n segments.some((generate) => generate.config?.dynamicParams === true) &&\n nextConfigOutput === 'export'\n ) {\n throw new Error(\n '\"dynamicParams: true\" cannot be used with \"output: export\". See more info here: https://nextjs.org/docs/app/building-your-application/deploying/static-exports'\n )\n }\n\n ComponentMod.patchFetch()\n\n const incrementalCache = await createIncrementalCache({\n dir,\n distDir,\n cacheHandler,\n cacheHandlers,\n requestHeaders,\n fetchCacheKeyPrefix,\n flushToDisk: isrFlushToDisk,\n cacheMaxMemorySize,\n })\n\n const childrenRouteParamSegments: Array<{\n readonly name: string\n readonly paramName: string\n readonly paramType: DynamicParamTypes\n }> = []\n const parallelRouteSegments: Array<{\n readonly name: string\n readonly paramName: string\n readonly paramType: DynamicParamTypes\n }> = []\n\n // These are all the parallel fallback route params that will be included when\n // we're emitting the route for the base route.\n const parallelFallbackRouteParams: FallbackRouteParam[] = []\n\n // First pass: collect all non-parallel route param names.\n // This allows us to filter out parallel route params that duplicate non-parallel ones.\n const nonParallelParamNames = new Set<string>()\n for (const segment of segments) {\n if (!segment.paramName || !segment.paramType) continue\n if (!segment.isParallelRouteSegment) {\n nonParallelParamNames.add(segment.paramName)\n }\n }\n\n // Second pass: collect segments, ensuring non-parallel route params take precedence.\n for (const segment of segments) {\n // If this segment doesn't have a param name then it's not param that we\n // need to resolve.\n if (!segment.paramName || !segment.paramType) continue\n\n if (segment.isParallelRouteSegment) {\n // Skip parallel route params that are already defined as non-parallel route params.\n // Non-parallel route params take precedence because they appear in the URL pathname.\n if (nonParallelParamNames.has(segment.paramName)) {\n continue\n }\n\n // Collect all the parallel route segments that have dynamic params for\n // second-pass resolution.\n parallelRouteSegments.push({\n name: segment.name,\n paramName: segment.paramName,\n paramType: segment.paramType,\n })\n parallelFallbackRouteParams.push(\n createFallbackRouteParam(segment.paramName, segment.paramType, true)\n )\n } else {\n // Collect all the route param keys that are not parallel route params.\n // These are the ones that will be included in the request pathname.\n childrenRouteParamSegments.push({\n name: segment.name,\n paramName: segment.paramName,\n paramType: segment.paramType,\n })\n }\n }\n\n const afterRunner = new AfterRunner()\n\n const store = createWorkStore({\n page,\n renderOpts: {\n incrementalCache,\n cacheLifeProfiles,\n supportsDynamicResponse: true,\n cacheComponents,\n experimental: {\n authInterrupts,\n },\n waitUntil: afterRunner.context.waitUntil,\n onClose: afterRunner.context.onClose,\n onAfterTaskError: afterRunner.context.onTaskError,\n },\n buildId,\n previouslyRevalidatedTags: [],\n })\n\n const routeParams = await ComponentMod.workAsyncStorage.run(\n store,\n generateRouteStaticParams,\n segments,\n store,\n isRoutePPREnabled\n )\n\n await afterRunner.executeAfter()\n\n let lastDynamicSegmentHadGenerateStaticParams = false\n for (const segment of segments) {\n // Check to see if there are any missing params for segments that have\n // dynamicParams set to false.\n if (\n segment.paramName &&\n segment.isDynamicSegment &&\n segment.config?.dynamicParams === false\n ) {\n for (const params of routeParams) {\n if (segment.paramName in params) continue\n\n const relative = segment.filePath\n ? path.relative(dir, segment.filePath)\n : undefined\n\n throw new Error(\n `Segment \"${relative}\" exports \"dynamicParams: false\" but the param \"${segment.paramName}\" is missing from the generated route params.`\n )\n }\n }\n\n if (\n segment.isDynamicSegment &&\n typeof segment.generateStaticParams !== 'function'\n ) {\n lastDynamicSegmentHadGenerateStaticParams = false\n } else if (typeof segment.generateStaticParams === 'function') {\n lastDynamicSegmentHadGenerateStaticParams = true\n }\n }\n\n // Determine if all the segments have had their parameters provided.\n const hadAllParamsGenerated =\n childrenRouteParamSegments.length === 0 ||\n (routeParams.length > 0 &&\n routeParams.every((params) => {\n for (const { paramName } of childrenRouteParamSegments) {\n if (paramName in params) continue\n return false\n }\n return true\n }))\n\n // TODO: dynamic params should be allowed to be granular per segment but\n // we need additional information stored/leveraged in the prerender\n // manifest to allow this behavior.\n const dynamicParams = segments.every(\n (segment) => segment.config?.dynamicParams !== false\n )\n\n const supportsRoutePreGeneration =\n hadAllParamsGenerated || process.env.NODE_ENV === 'production'\n\n const fallbackMode = dynamicParams\n ? supportsRoutePreGeneration\n ? isRoutePPREnabled\n ? FallbackMode.PRERENDER\n : FallbackMode.BLOCKING_STATIC_RENDER\n : undefined\n : FallbackMode.NOT_FOUND\n\n const prerenderedRoutesByPathname = new Map<string, PrerenderedRoute>()\n\n // Convert rootParamKeys to Set for O(1) lookup.\n const rootParamSet = new Set(rootParamKeys)\n\n if (hadAllParamsGenerated || isRoutePPREnabled) {\n let paramsToProcess = routeParams\n\n if (isRoutePPREnabled) {\n // Discover all unique combinations of the routeParams so we can generate\n // routes that won't throw on empty static shell for each of them if\n // they're available.\n paramsToProcess = generateAllParamCombinations(\n childrenRouteParamSegments,\n routeParams,\n rootParamKeys\n )\n\n // The fallback route params for this route is a combination of the\n // parallel route params and the non-parallel route params.\n const fallbackRouteParams: readonly FallbackRouteParam[] = [\n ...childrenRouteParamSegments.map(({ paramName, paramType: type }) =>\n createFallbackRouteParam(paramName, type, false)\n ),\n ...parallelFallbackRouteParams,\n ]\n\n // Add the base route, this is the route with all the placeholders as it's\n // derived from the `page` string.\n prerenderedRoutesByPathname.set(page, {\n params: {},\n pathname: page,\n encodedPathname: page,\n fallbackRouteParams,\n fallbackMode: calculateFallbackMode(\n dynamicParams,\n rootParamKeys,\n fallbackMode\n ),\n fallbackRootParams: rootParamKeys,\n throwOnEmptyStaticShell: true,\n })\n }\n\n filterUniqueParams(\n childrenRouteParamSegments,\n validateParams(\n page,\n isRoutePPREnabled,\n childrenRouteParamSegments,\n rootParamKeys,\n paramsToProcess\n )\n ).forEach((params) => {\n let pathname = page\n let encodedPathname = page\n\n const fallbackRouteParams: FallbackRouteParam[] = []\n\n for (const {\n paramName: key,\n paramType: type,\n } of childrenRouteParamSegments) {\n const paramValue = params[key]\n\n if (!paramValue) {\n if (isRoutePPREnabled) {\n // Mark remaining params as fallback params.\n fallbackRouteParams.push(createFallbackRouteParam(key, type, false))\n for (\n let i =\n childrenRouteParamSegments.findIndex(\n (param) => param.paramName === key\n ) + 1;\n i < childrenRouteParamSegments.length;\n i++\n ) {\n fallbackRouteParams.push(\n createFallbackRouteParam(\n childrenRouteParamSegments[i].paramName,\n childrenRouteParamSegments[i].paramType,\n false\n )\n )\n }\n break\n } else {\n // This route is not complete, and we aren't performing a partial\n // prerender, so we should return, skipping this route.\n return\n }\n }\n\n const segment = childrenRouteParamSegments.find(\n ({ paramName }) => paramName === key\n )\n if (!segment) {\n throw new InvariantError(\n `Param ${key} not found in childrenRouteParamSegments ${childrenRouteParamSegments.map(({ paramName }) => paramName).join(', ')}`\n )\n }\n\n pathname = pathname.replace(\n segment.name,\n encodeParam(paramValue, (value) => escapePathDelimiters(value, true))\n )\n encodedPathname = encodedPathname.replace(\n segment.name,\n encodeParam(paramValue, encodeURIComponent)\n )\n }\n\n // Resolve parallel route params from the regular route params\n resolveParallelRouteParams(\n parallelRouteSegments,\n params,\n pathname,\n fallbackRouteParams\n )\n\n const fallbackRootParams: string[] = []\n for (const { paramName, isParallelRouteParam } of fallbackRouteParams) {\n // Only add the param to the fallback root params if it's not a\n // parallel route param. They won't contribute to the request pathname.\n if (isParallelRouteParam) continue\n\n // If the param is a root param then we can add it to the fallback\n // root params.\n if (rootParamSet.has(paramName)) {\n fallbackRootParams.push(paramName)\n }\n }\n\n pathname = normalizePathname(pathname)\n\n prerenderedRoutesByPathname.set(pathname, {\n params,\n pathname,\n encodedPathname: normalizePathname(encodedPathname),\n fallbackRouteParams,\n fallbackMode: calculateFallbackMode(\n dynamicParams,\n fallbackRootParams,\n fallbackMode\n ),\n fallbackRootParams,\n throwOnEmptyStaticShell: true,\n })\n })\n }\n\n const prerenderedRoutes =\n prerenderedRoutesByPathname.size > 0 ||\n lastDynamicSegmentHadGenerateStaticParams\n ? [...prerenderedRoutesByPathname.values()]\n : undefined\n\n // Now we have to set the throwOnEmptyStaticShell for each of the routes.\n if (prerenderedRoutes && cacheComponents) {\n assignErrorIfEmpty(prerenderedRoutes, childrenRouteParamSegments)\n }\n\n return { fallbackMode, prerenderedRoutes }\n}\n"],"names":["path","AfterRunner","createWorkStore","FallbackMode","normalizePathname","encodeParam","createFallbackRouteParam","escapePathDelimiters","createIncrementalCache","InvariantError","getParamProperties","throwEmptyGenerateStaticParamsError","filterUniqueParams","childrenRouteParams","routeParams","unique","Map","params","key","paramName","paramKey","value","valuePart","Array","isArray","join","undefined","has","set","from","values","generateAllParamCombinations","rootParamKeys","combinations","minIndexForCompleteRootParams","length","rootParamKey","index","findIndex","param","Math","max","i","combination","keyParts","hasAllRootParams","j","routeKey","hasOwnProperty","includes","push","currentKey","calculateFallbackMode","dynamicParams","fallbackRootParams","baseFallbackMode","BLOCKING_STATIC_RENDER","NOT_FOUND","validateParams","page","isRoutePPREnabled","childrenRouteParamSegments","valid","some","Error","item","paramType","repeat","optional","paramValue","assignErrorIfEmpty","prerenderedRoutes","root","children","routes","route","currentNode","valueKey","childNode","get","stack","node","pop","hasChildren","size","minFallbacks","Infinity","r","min","fallbackRouteParams","throwOnEmptyStaticShell","child","resolveParallelRouteParams","parallelRouteSegments","pathname","isParallelRouteParam","pathSegments","split","filter","Boolean","generateRouteStaticParams","segments","store","queue","segmentIndex","currentParams","current","shift","generateStaticParams","config","fetchCache","nextParams","parentParams","result","buildAppStaticPaths","dir","distDir","cacheComponents","authInterrupts","isrFlushToDisk","cacheHandler","cacheLifeProfiles","requestHeaders","cacheHandlers","cacheMaxMemorySize","fetchCacheKeyPrefix","nextConfigOutput","ComponentMod","buildId","generate","patchFetch","incrementalCache","flushToDisk","parallelFallbackRouteParams","nonParallelParamNames","Set","segment","isParallelRouteSegment","add","name","afterRunner","renderOpts","supportsDynamicResponse","experimental","waitUntil","context","onClose","onAfterTaskError","onTaskError","previouslyRevalidatedTags","workAsyncStorage","run","executeAfter","lastDynamicSegmentHadGenerateStaticParams","isDynamicSegment","relative","filePath","hadAllParamsGenerated","every","supportsRoutePreGeneration","process","env","NODE_ENV","fallbackMode","PRERENDER","prerenderedRoutesByPathname","rootParamSet","paramsToProcess","map","type","encodedPathname","forEach","find","replace","encodeURIComponent"],"mappings":"AASA,OAAOA,UAAU,YAAW;AAC5B,SAASC,WAAW,QAAQ,oCAAmC;AAC/D,SAASC,eAAe,QAAQ,wCAAuC;AACvE,SAASC,YAAY,QAAQ,qBAAoB;AAEjD,SACEC,iBAAiB,EACjBC,WAAW,EACXC,wBAAwB,QACnB,UAAS;AAChB,OAAOC,0BAA0B,uDAAsD;AACvF,SAASC,sBAAsB,QAAQ,gDA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;QACF;IACF;IAEA,MAAMnB,oBACJ8F,4BAA4BjF,IAAI,GAAG,KACnCqE,4CACI;WAAIY,4BAA4BvI,MAAM;KAAG,GACzCJ;IAEN,yEAAyE;IACzE,IAAI6C,qBAAqB8C,iBAAiB;QACxC/C,mBAAmBC,mBAAmBV;IACxC;IAEA,OAAO;QAAEsG;QAAc5F;IAAkB;AAC3C","ignoreList":[0]}
1
+ {"version":3,"sources":["../../../src/build/static-paths/app.ts"],"sourcesContent":["import type { Params } from '../../server/request/params'\nimport type { AppPageModule } from '../../server/route-modules/app-page/module'\nimport type { AppSegment } from '../segment-config/app/app-segments'\nimport type {\n FallbackRouteParam,\n PrerenderedRoute,\n StaticPathsResult,\n} from './types'\n\nimport path from 'node:path'\nimport { AfterRunner } from '../../server/after/run-with-after'\nimport { createWorkStore } from '../../server/async-storage/work-store'\nimport { FallbackMode } from '../../lib/fallback'\nimport type { IncrementalCache } from '../../server/lib/incremental-cache'\nimport type { LoaderTree } from '../../server/lib/app-dir-module'\nimport {\n normalizePathname,\n encodeParam,\n createFallbackRouteParam,\n} from './utils'\nimport escapePathDelimiters from '../../shared/lib/router/utils/escape-path-delimiters'\nimport { createIncrementalCache } from '../../export/helpers/create-incremental-cache'\nimport type { NextConfigComplete } from '../../server/config-shared'\nimport type { WorkStore } from '../../server/app-render/work-async-storage.external'\nimport type { DynamicParamTypes } from '../../shared/lib/app-router-types'\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport {\n getParamProperties,\n getSegmentParam,\n} from '../../shared/lib/router/utils/get-segment-param'\nimport { parseLoaderTree } from '../../shared/lib/router/utils/parse-loader-tree'\nimport { INTERCEPTION_ROUTE_MARKERS } from '../../shared/lib/router/utils/interception-routes'\nimport { throwEmptyGenerateStaticParamsError } from '../../shared/lib/errors/empty-generate-static-params-error'\nimport type { AppRouteModule } from '../../server/route-modules/app-route/module.compiled'\n\n/**\n * Filters out duplicate parameters from a list of parameters.\n * This function uses a Map to efficiently store and retrieve unique parameter combinations.\n *\n * @param childrenRouteParams - The keys of the parameters. These should be sorted to ensure consistent key generation.\n * @param routeParams - The list of parameter objects to filter.\n * @returns A new array containing only the unique parameter combinations.\n */\nexport function filterUniqueParams(\n childrenRouteParams: readonly { paramName: string }[],\n routeParams: readonly Params[]\n): Params[] {\n // A Map is used to store unique parameter combinations. The key of the Map\n // is a string representation of the parameter combination, and the value\n // is the actual `Params` object.\n const unique = new Map<string, Params>()\n\n // Iterate over each parameter object in the input array.\n for (const params of routeParams) {\n let key = '' // Initialize an empty string to build the unique key for the current `params` object.\n\n // Iterate through the `routeParamKeys` (which are assumed to be sorted).\n // This consistent order is crucial for generating a stable and unique key\n // for each parameter combination.\n for (const { paramName: paramKey } of childrenRouteParams) {\n const value = params[paramKey]\n\n // Construct a part of the key using the parameter key and its value.\n // A type prefix (`A:` for Array, `S:` for String, `U:` for undefined) is added to the value\n // to prevent collisions. For example, `['a', 'b']` and `'a,b'` would\n // otherwise generate the same string representation, leading to incorrect\n // deduplication. This ensures that different types with the same string\n // representation are treated as distinct.\n let valuePart: string\n if (Array.isArray(value)) {\n valuePart = `A:${value.join(',')}`\n } else if (value === undefined) {\n valuePart = `U:undefined`\n } else {\n valuePart = `S:${value}`\n }\n key += `${paramKey}:${valuePart}|`\n }\n\n // If the generated key is not already in the `unique` Map, it means this\n // parameter combination is unique so far. Add it to the Map.\n if (!unique.has(key)) {\n unique.set(key, params)\n }\n }\n\n // Convert the Map's values (the unique `Params` objects) back into an array\n // and return it.\n return Array.from(unique.values())\n}\n\n/**\n * Generates all unique sub-combinations of Route Parameters from a list of Static Parameters.\n * This function creates all possible prefixes of the Route Parameters, which is\n * useful for generating Static Shells that can serve as Fallback Shells for more specific Route Shells.\n *\n * When Root Parameters are provided, the function ensures that Static Shells only\n * include complete sets of Root Parameters. This prevents generating invalid Static Shells\n * that are missing required Root Parameters.\n *\n * Example with Root Parameters ('lang', 'region') and Route Parameters ('lang', 'region', 'slug'):\n *\n * Given the following Static Parameters:\n * ```\n * [\n * { lang: 'en', region: 'US', slug: ['home'] },\n * { lang: 'en', region: 'US', slug: ['about'] },\n * { lang: 'fr', region: 'CA', slug: ['about'] },\n * ]\n * ```\n *\n * The result will be:\n * ```\n * [\n * { lang: 'en', region: 'US' }, // Complete Root Parameters\n * { lang: 'en', region: 'US', slug: ['home'] },\n * { lang: 'en', region: 'US', slug: ['about'] },\n * { lang: 'fr', region: 'CA' }, // Complete Root Parameters\n * { lang: 'fr', region: 'CA', slug: ['about'] },\n * ]\n * ```\n *\n * Note that partial combinations like `{ lang: 'en' }` are NOT generated because\n * they don't include the complete set of Root Parameters.\n *\n * For routes without Root Parameters (e.g., `/[slug]`), all sub-combinations are generated\n * as before.\n *\n * @param childrenRouteParams - The children route params. These should be sorted\n * to ensure consistent key generation for the internal Map.\n * @param routeParams - The list of Static Parameters to filter.\n * @param rootParamKeys - The keys of the Root Parameters. When provided, ensures Static Shells\n * include all Root Parameters.\n * @returns A new array containing all unique sub-combinations of Route Parameters.\n */\nexport function generateAllParamCombinations(\n childrenRouteParams: ReadonlyArray<{\n readonly paramName: string\n }>,\n routeParams: readonly Params[],\n rootParamKeys: readonly string[]\n): Params[] {\n // A Map is used to store unique combinations of Route Parameters.\n // The key of the Map is a string representation of the Route Parameter\n // combination, and the value is the `Params` object containing only\n // the Route Parameters.\n const combinations = new Map<string, Params>()\n\n // Determine the minimum index where all Root Parameters are included.\n // This optimization ensures we only generate combinations that include\n // a complete set of Root Parameters, preventing invalid Static Shells.\n //\n // For example, if rootParamKeys = ['lang', 'region'] and routeParamKeys = ['lang', 'region', 'slug']:\n // - 'lang' is at index 0, 'region' is at index 1\n // - minIndexForCompleteRootParams = max(0, 1) = 1\n // - We'll only generate combinations starting from index 1 (which includes both lang and region)\n let minIndexForCompleteRootParams = -1\n if (rootParamKeys.length > 0) {\n // Find the index of the last Root Parameter in routeParamKeys.\n // This tells us the minimum combination length needed to include all Root Parameters.\n for (const rootParamKey of rootParamKeys) {\n const index = childrenRouteParams.findIndex(\n (param) => param.paramName === rootParamKey\n )\n if (index === -1) {\n // Root Parameter not found in Route Parameters - this shouldn't happen in normal cases\n // but we handle it gracefully by treating it as if there are no Root Parameters.\n // This allows the function to fall back to generating all sub-combinations.\n minIndexForCompleteRootParams = -1\n break\n }\n // Track the highest index among all Root Parameters.\n // This ensures all Root Parameters are included in any generated combination.\n minIndexForCompleteRootParams = Math.max(\n minIndexForCompleteRootParams,\n index\n )\n }\n }\n\n // Iterate over each Static Parameter object in the input array.\n // Each params object represents one potential route combination (e.g., { lang: 'en', region: 'US', slug: 'home' })\n for (const params of routeParams) {\n // Generate all possible prefix combinations for this Static Parameter set.\n // For routeParamKeys = ['lang', 'region', 'slug'], we'll generate combinations at:\n // - i=0: { lang: 'en' }\n // - i=1: { lang: 'en', region: 'US' }\n // - i=2: { lang: 'en', region: 'US', slug: 'home' }\n //\n // The iteration order is crucial for generating stable and unique keys\n // for each Route Parameter combination.\n for (let i = 0; i < childrenRouteParams.length; i++) {\n // Skip generating combinations that don't include all Root Parameters.\n // This prevents creating invalid Static Shells that are missing required Root Parameters.\n //\n // For example, if Root Parameters are ['lang', 'region'] and minIndexForCompleteRootParams = 1:\n // - Skip i=0 (would only include 'lang', missing 'region')\n // - Process i=1 and higher (includes both 'lang' and 'region')\n if (\n minIndexForCompleteRootParams >= 0 &&\n i < minIndexForCompleteRootParams\n ) {\n continue\n }\n\n // Initialize data structures for building this specific combination\n const combination: Params = {}\n const keyParts: string[] = []\n let hasAllRootParams = true\n\n // Build the sub-combination with parameters from index 0 to i (inclusive).\n // This creates a prefix of the full parameter set, building up combinations incrementally.\n //\n // For example, if routeParamKeys = ['lang', 'region', 'slug'] and i = 1:\n // - j=0: Add 'lang' parameter\n // - j=1: Add 'region' parameter\n // Result: { lang: 'en', region: 'US' }\n for (let j = 0; j <= i; j++) {\n const { paramName: routeKey } = childrenRouteParams[j]\n\n // Check if the parameter exists in the original params object and has a defined value.\n // This handles cases where generateStaticParams doesn't provide all possible parameters,\n // or where some parameters are optional/undefined.\n if (\n !params.hasOwnProperty(routeKey) ||\n params[routeKey] === undefined\n ) {\n // If this missing parameter is a Root Parameter, mark the combination as invalid.\n // Root Parameters are required for Static Shells, so we can't generate partial combinations without them.\n if (rootParamKeys.includes(routeKey)) {\n hasAllRootParams = false\n }\n // Stop building this combination since we've hit a missing parameter.\n // This ensures we only generate valid prefix combinations with consecutive parameters.\n break\n }\n\n const value = params[routeKey]\n combination[routeKey] = value\n\n // Construct a unique key part for this parameter to enable deduplication.\n // We use type prefixes to prevent collisions between different value types\n // that might have the same string representation.\n //\n // Examples:\n // - Array ['foo', 'bar'] becomes \"A:foo,bar\"\n // - String \"foo,bar\" becomes \"S:foo,bar\"\n // - This prevents collisions between ['foo', 'bar'] and \"foo,bar\"\n let valuePart: string\n if (Array.isArray(value)) {\n valuePart = `A:${value.join(',')}`\n } else {\n valuePart = `S:${value}`\n }\n keyParts.push(`${routeKey}:${valuePart}`)\n }\n\n // Build the final unique key by joining all parameter parts.\n // This key is used for deduplication in the combinations Map.\n // Format: \"lang:S:en|region:S:US|slug:A:home,about\"\n const currentKey = keyParts.join('|')\n\n // Only add the combination if it meets our criteria:\n // 1. hasAllRootParams: Contains all required Root Parameters\n // 2. !combinations.has(currentKey): Is not a duplicate of an existing combination\n //\n // This ensures we only generate valid, unique parameter combinations for Static Shells.\n if (hasAllRootParams && !combinations.has(currentKey)) {\n combinations.set(currentKey, combination)\n }\n }\n }\n\n // Convert the Map's values back into an array and return the final result.\n // The Map ensures all combinations are unique, and we return only the\n // parameter objects themselves, discarding the internal deduplication keys.\n return Array.from(combinations.values())\n}\n\n/**\n * Calculates the fallback mode based on the given parameters.\n *\n * @param dynamicParams - Whether dynamic params are enabled.\n * @param fallbackRootParams - The root params that are part of the fallback.\n * @param baseFallbackMode - The base fallback mode to use.\n * @returns The calculated fallback mode.\n */\nexport function calculateFallbackMode(\n dynamicParams: boolean,\n fallbackRootParams: readonly string[],\n baseFallbackMode: FallbackMode | undefined\n): FallbackMode {\n return dynamicParams\n ? // If the fallback params includes any root params, then we need to\n // perform a blocking static render.\n fallbackRootParams.length > 0\n ? FallbackMode.BLOCKING_STATIC_RENDER\n : (baseFallbackMode ?? FallbackMode.NOT_FOUND)\n : FallbackMode.NOT_FOUND\n}\n\n/**\n * Validates the parameters to ensure they're accessible and have the correct\n * types.\n *\n * @param page - The page to validate.\n * @param regex - The route regex.\n * @param isRoutePPREnabled - Whether the route has partial prerendering enabled.\n * @param childrenRouteParamSegments - The keys of the parameters.\n * @param rootParamKeys - The keys of the root params.\n * @param routeParams - The list of parameters to validate.\n * @returns The list of validated parameters.\n */\nfunction validateParams(\n page: string,\n isRoutePPREnabled: boolean,\n childrenRouteParamSegments: ReadonlyArray<{\n readonly paramName: string\n readonly paramType: DynamicParamTypes\n }>,\n rootParamKeys: readonly string[],\n routeParams: readonly Params[]\n): Params[] {\n const valid: Params[] = []\n\n // Validate that if there are any root params, that the user has provided at\n // least one value for them only if we're using partial prerendering.\n if (isRoutePPREnabled && rootParamKeys.length > 0) {\n if (\n routeParams.length === 0 ||\n rootParamKeys.some((key) =>\n routeParams.some((params) => !(key in params))\n )\n ) {\n if (rootParamKeys.length === 1) {\n throw new Error(\n `A required root parameter (${rootParamKeys[0]}) was not provided in generateStaticParams for ${page}, please provide at least one value.`\n )\n }\n\n throw new Error(\n `Required root params (${rootParamKeys.join(', ')}) were not provided in generateStaticParams for ${page}, please provide at least one value for each.`\n )\n }\n }\n\n for (const params of routeParams) {\n const item: Params = {}\n\n for (const { paramName: key, paramType } of childrenRouteParamSegments) {\n const { repeat, optional } = getParamProperties(paramType)\n\n let paramValue = params[key]\n\n if (\n optional &&\n params.hasOwnProperty(key) &&\n (paramValue === null ||\n paramValue === undefined ||\n (paramValue as any) === false)\n ) {\n paramValue = []\n }\n\n // A parameter is missing, so the rest of the params are not accessible.\n // We only support this when the route has partial prerendering enabled.\n // This will make it so that the remaining params are marked as missing so\n // we can generate a fallback route for them.\n if (!paramValue && isRoutePPREnabled) {\n break\n }\n\n // Perform validation for the parameter based on whether it's a repeat\n // parameter or not.\n if (repeat) {\n if (!Array.isArray(paramValue)) {\n throw new Error(\n `A required parameter (${key}) was not provided as an array received ${typeof paramValue} in generateStaticParams for ${page}`\n )\n }\n } else {\n if (typeof paramValue !== 'string') {\n throw new Error(\n `A required parameter (${key}) was not provided as a string received ${typeof paramValue} in generateStaticParams for ${page}`\n )\n }\n }\n\n item[key] = paramValue\n }\n\n valid.push(item)\n }\n\n return valid\n}\n\ninterface TrieNode {\n /**\n * The children of the node. Each key is a unique string representation of a parameter value,\n * and the value is the next TrieNode in the path.\n */\n children: Map<string, TrieNode>\n\n /**\n * The routes that are associated with this specific parameter combination (node).\n * These are the routes whose concrete parameters lead to this node in the Trie.\n */\n routes: PrerenderedRoute[]\n}\n\n/**\n * Assigns the throwOnEmptyStaticShell property to each of the prerendered routes.\n * This function uses a Trie data structure to efficiently determine whether each route\n * should throw an error when its static shell is empty.\n *\n * A route should not throw on empty static shell if it has child routes in the Trie. For example,\n * if we have two routes, `/blog/first-post` and `/blog/[slug]`, the route for\n * `/blog/[slug]` should not throw because `/blog/first-post` is a more specific concrete route.\n *\n * @param prerenderedRoutes - The prerendered routes.\n * @param childrenRouteParams - The keys of the route parameters.\n */\nexport function assignErrorIfEmpty(\n prerenderedRoutes: readonly PrerenderedRoute[],\n childrenRouteParams: ReadonlyArray<{\n readonly paramName: string\n }>\n): void {\n // If there are no routes to process, exit early.\n if (prerenderedRoutes.length === 0) {\n return\n }\n\n // Initialize the root of the Trie. This node represents the starting point\n // before any parameters have been considered.\n const root: TrieNode = { children: new Map(), routes: [] }\n\n // Phase 1: Build the Trie.\n // Iterate over each prerendered route and insert it into the Trie.\n // Each route's concrete parameter values form a path in the Trie.\n for (const route of prerenderedRoutes) {\n let currentNode = root // Start building the path from the root for each route.\n\n // Iterate through the sorted parameter keys. The order of keys is crucial\n // for ensuring that routes with the same concrete parameters follow the\n // same path in the Trie, regardless of the original order of properties\n // in the `params` object.\n for (const { paramName: key } of childrenRouteParams) {\n // Check if the current route actually has a concrete value for this parameter.\n // If a dynamic segment is not filled (i.e., it's a fallback), it won't have\n // this property, and we stop building the path for this route at this point.\n if (route.params.hasOwnProperty(key)) {\n const value = route.params[key]\n\n // Generate a unique key for the parameter's value. This is critical\n // to prevent collisions between different data types that might have\n // the same string representation (e.g., `['a', 'b']` vs `'a,b'`).\n // A type prefix (`A:` for Array, `S:` for String, `U:` for undefined)\n // is added to the value to prevent collisions. This ensures that\n // different types with the same string representation are treated as\n // distinct.\n let valueKey: string\n if (Array.isArray(value)) {\n valueKey = `A:${value.join(',')}`\n } else if (value === undefined) {\n valueKey = `U:undefined`\n } else {\n valueKey = `S:${value}`\n }\n\n // Look for a child node corresponding to this `valueKey` from the `currentNode`.\n let childNode = currentNode.children.get(valueKey)\n if (!childNode) {\n // If the child node doesn't exist, create a new one and add it to\n // the current node's children.\n childNode = { children: new Map(), routes: [] }\n currentNode.children.set(valueKey, childNode)\n }\n // Move deeper into the Trie to the `childNode` for the next parameter.\n currentNode = childNode\n }\n }\n // After processing all concrete parameters for the route, add the full\n // `PrerenderedRoute` object to the `routes` array of the `currentNode`.\n // This node represents the unique concrete parameter combination for this route.\n currentNode.routes.push(route)\n }\n\n // Phase 2: Traverse the Trie to assign the `throwOnEmptyStaticShell` property.\n // This is done using an iterative Depth-First Search (DFS) approach with an\n // explicit stack to avoid JavaScript's recursion depth limits (stack overflow)\n // for very deep routing structures.\n const stack: TrieNode[] = [root] // Initialize the stack with the root node.\n\n while (stack.length > 0) {\n const node = stack.pop()! // Pop the next node to process from the stack.\n\n // `hasChildren` indicates if this node has any more specific concrete\n // parameter combinations branching off from it. If true, it means this\n // node represents a prefix for other, more specific routes.\n const hasChildren = node.children.size > 0\n\n // If the current node has routes associated with it (meaning, routes whose\n // concrete parameters lead to this node's path in the Trie).\n if (node.routes.length > 0) {\n // Determine the minimum number of fallback parameters among all routes\n // that are associated with this current Trie node. This is used to\n // identify if a route should not throw on empty static shell relative to another route *at the same level*\n // of concrete parameters, but with fewer fallback parameters.\n let minFallbacks = Infinity\n for (const r of node.routes) {\n // `fallbackRouteParams?.length ?? 0` handles cases where `fallbackRouteParams`\n // might be `undefined` or `null`, treating them as 0 length.\n minFallbacks = Math.min(\n minFallbacks,\n r.fallbackRouteParams ? r.fallbackRouteParams.length : 0\n )\n }\n\n // Now, for each `PrerenderedRoute` associated with this node:\n for (const route of node.routes) {\n // A route is ok not to throw on an empty static shell (and thus\n // `throwOnEmptyStaticShell` should be `false`) if either of the\n // following conditions is met:\n // 1. `hasChildren` is true: This node has further concrete parameter children.\n // This means the current route is a parent to more specific routes (e.g.,\n // `/blog/[slug]` should not throw when concrete routes like `/blog/first-post` exist).\n // OR\n // 2. `route.fallbackRouteParams.length > minFallbacks`: This route has\n // more fallback parameters than another route at the same Trie node.\n // This implies the current route is a more general version that should not throw\n // compared to a more specific route that has fewer fallback parameters\n // (e.g., `/1234/[...slug]` should not throw relative to `/[id]/[...slug]`).\n if (\n hasChildren ||\n (route.fallbackRouteParams &&\n route.fallbackRouteParams.length > minFallbacks)\n ) {\n route.throwOnEmptyStaticShell = false // Should not throw on empty static shell.\n } else {\n route.throwOnEmptyStaticShell = true // Should throw on empty static shell.\n }\n }\n }\n\n // Add all children of the current node to the stack. This ensures that\n // the traversal continues to explore deeper paths in the Trie.\n for (const child of node.children.values()) {\n stack.push(child)\n }\n }\n}\n\n/**\n * Resolves parallel route parameters from the loader tree. This function uses\n * tree-based traversal to correctly handle the hierarchical structure of parallel\n * routes and accurately determine parameter values based on their depth in the tree.\n *\n * Unlike interpolateParallelRouteParams (which has a complete URL at runtime),\n * this build-time function determines which parallel route params are unknown.\n * The pathname may contain placeholders like [slug], making it incomplete.\n *\n * @param loaderTree - The loader tree structure containing route hierarchy\n * @param params - The current route parameters object (will be mutated)\n * @param pathname - The current pathname being processed (may contain placeholders)\n * @param fallbackRouteParams - Array of fallback route parameters (will be mutated)\n */\nexport function resolveParallelRouteParams(\n loaderTree: LoaderTree,\n params: Params,\n pathname: string,\n fallbackRouteParams: FallbackRouteParam[]\n): void {\n // Stack-based traversal with depth and parallel route key tracking\n const stack: Array<{\n tree: LoaderTree\n depth: number\n parallelKey: string\n }> = [{ tree: loaderTree, depth: 0, parallelKey: 'children' }]\n\n // Parse pathname into segments for depth-based resolution\n const pathSegments = pathname.split('/').filter(Boolean)\n\n while (stack.length > 0) {\n const { tree, depth, parallelKey } = stack.pop()!\n const { segment, parallelRoutes } = parseLoaderTree(tree)\n\n // Only process segments that are in parallel routes (not the main 'children' route)\n if (parallelKey !== 'children') {\n const segmentParam = getSegmentParam(segment)\n\n if (segmentParam && !params.hasOwnProperty(segmentParam.param)) {\n const { param: paramName, type: paramType } = segmentParam\n\n switch (paramType) {\n case 'catchall':\n case 'optional-catchall':\n case 'catchall-intercepted':\n // If there are any non-parallel fallback route segments, we can't use the\n // pathname to derive the value because it's not complete. We can make\n // this assumption because routes are resolved left to right.\n if (\n fallbackRouteParams.some((param) => !param.isParallelRouteParam)\n ) {\n fallbackRouteParams.push(\n createFallbackRouteParam(paramName, paramType, true)\n )\n break\n }\n\n // For catchall routes in parallel segments, derive from pathname\n // using depth to determine which segments to use\n const remainingSegments = pathSegments.slice(depth)\n\n // Process segments to handle any embedded dynamic params\n // Track if we encounter any unknown param placeholders\n let hasUnknownParam = false\n const processedSegments = remainingSegments\n .flatMap((pathSegment) => {\n const param = getSegmentParam(pathSegment)\n if (param) {\n // If the segment is a param placeholder, check if we have its value\n if (!params.hasOwnProperty(param.param)) {\n // Unknown param placeholder in pathname - can't derive full value\n hasUnknownParam = true\n return undefined\n }\n // If the segment matches a param, return the param value\n // We don't encode values here as that's handled during retrieval.\n return params[param.param]\n }\n // Otherwise it's a static segment\n return pathSegment\n })\n .filter((s) => s !== undefined)\n\n // If we encountered any unknown param placeholders, we can't derive\n // the full catch-all value from the pathname, so mark as fallback.\n if (hasUnknownParam) {\n fallbackRouteParams.push(\n createFallbackRouteParam(paramName, paramType, true)\n )\n break\n }\n\n if (processedSegments.length > 0) {\n params[paramName] = processedSegments\n } else if (paramType === 'optional-catchall') {\n params[paramName] = []\n } else {\n // We shouldn't be able to match a catchall segment without any path\n // segments if it's not an optional catchall\n throw new InvariantError(\n `Unexpected empty path segments match for a pathname \"${pathname}\" with param \"${paramName}\" of type \"${paramType}\"`\n )\n }\n break\n\n case 'dynamic':\n case 'dynamic-intercepted':\n // For regular dynamic parameters, take the segment at this depth\n if (depth < pathSegments.length) {\n const pathSegment = pathSegments[depth]\n const param = getSegmentParam(pathSegment)\n\n // Check if the segment at this depth is a placeholder for an unknown param\n if (param && !params.hasOwnProperty(param.param)) {\n // The segment is a placeholder like [category] and we don't have the value\n fallbackRouteParams.push(\n createFallbackRouteParam(paramName, paramType, true)\n )\n break\n }\n\n // If the segment matches a param, use the param value from params object\n // Otherwise it's a static segment, just use it directly\n // We don't encode values here as that's handled during retrieval\n params[paramName] = param ? params[param.param] : pathSegment\n } else {\n // No segment at this depth, mark as fallback.\n fallbackRouteParams.push(\n createFallbackRouteParam(paramName, paramType, true)\n )\n }\n break\n\n default:\n paramType satisfies never\n }\n }\n }\n\n // Calculate next depth - increment if this is not a route group and not empty\n let nextDepth = depth\n // Route groups are like (marketing) or (dashboard), NOT interception routes like (.)photo\n // Interception routes start with markers like (.), (..), (...), (..)(..)) and should increment depth\n const isInterceptionRoute = INTERCEPTION_ROUTE_MARKERS.some((marker) =>\n segment.startsWith(marker)\n )\n const isRouteGroup =\n !isInterceptionRoute && segment.startsWith('(') && segment.endsWith(')')\n if (!isRouteGroup && segment !== '') {\n nextDepth++\n }\n\n // Add all parallel routes to the stack for processing.\n for (const [key, route] of Object.entries(parallelRoutes)) {\n stack.push({ tree: route, depth: nextDepth, parallelKey: key })\n }\n }\n}\n\n/**\n * Processes app directory segments to build route parameters from generateStaticParams functions.\n * This function walks through the segments array and calls generateStaticParams for each segment that has it,\n * combining parent parameters with child parameters to build the complete parameter combinations.\n * Uses iterative processing instead of recursion for better performance.\n *\n * @param segments - Array of app directory segments to process\n * @param store - Work store for tracking fetch cache configuration\n * @returns Promise that resolves to an array of all parameter combinations\n */\nexport async function generateRouteStaticParams(\n segments: ReadonlyArray<\n Readonly<Pick<AppSegment, 'config' | 'generateStaticParams'>>\n >,\n store: Pick<WorkStore, 'fetchCache'>,\n isRoutePPREnabled: boolean\n): Promise<Params[]> {\n // Early return if no segments to process\n if (segments.length === 0) return []\n\n // Use iterative processing with a work queue to avoid recursion overhead\n interface WorkItem {\n segmentIndex: number\n params: Params[]\n }\n\n const queue: WorkItem[] = [{ segmentIndex: 0, params: [] }]\n let currentParams: Params[] = []\n\n while (queue.length > 0) {\n const { segmentIndex, params } = queue.shift()!\n\n // If we've processed all segments, this is our final result\n if (segmentIndex >= segments.length) {\n currentParams = params\n break\n }\n\n const current = segments[segmentIndex]\n\n // Skip segments without generateStaticParams and continue to next\n if (typeof current.generateStaticParams !== 'function') {\n queue.push({ segmentIndex: segmentIndex + 1, params })\n continue\n }\n\n // Configure fetchCache if specified\n if (current.config?.fetchCache !== undefined) {\n store.fetchCache = current.config.fetchCache\n }\n\n const nextParams: Params[] = []\n\n // If there are parent params, we need to process them.\n if (params.length > 0) {\n // Process each parent parameter combination\n for (const parentParams of params) {\n const result = await current.generateStaticParams({\n params: parentParams,\n })\n\n if (result.length > 0) {\n // Merge parent params with each result item\n for (const item of result) {\n nextParams.push({ ...parentParams, ...item })\n }\n } else if (isRoutePPREnabled) {\n throwEmptyGenerateStaticParamsError()\n } else {\n // No results, just pass through parent params\n nextParams.push(parentParams)\n }\n }\n } else {\n // No parent params, call generateStaticParams with empty object\n const result = await current.generateStaticParams({ params: {} })\n if (result.length === 0 && isRoutePPREnabled) {\n throwEmptyGenerateStaticParamsError()\n }\n\n nextParams.push(...result)\n }\n\n // Add next segment to work queue\n queue.push({ segmentIndex: segmentIndex + 1, params: nextParams })\n }\n\n return currentParams\n}\n\n/**\n * Builds the static paths for an app using `generateStaticParams`.\n *\n * @param params - The parameters for the build.\n * @returns The static paths.\n */\nexport async function buildAppStaticPaths({\n dir,\n page,\n distDir,\n cacheComponents,\n authInterrupts,\n segments,\n isrFlushToDisk,\n cacheHandler,\n cacheLifeProfiles,\n requestHeaders,\n cacheHandlers,\n cacheMaxMemorySize,\n fetchCacheKeyPrefix,\n nextConfigOutput,\n ComponentMod,\n isRoutePPREnabled = false,\n buildId,\n rootParamKeys,\n}: {\n dir: string\n page: string\n cacheComponents: boolean\n authInterrupts: boolean\n segments: readonly Readonly<AppSegment>[]\n distDir: string\n isrFlushToDisk?: boolean\n fetchCacheKeyPrefix?: string\n cacheHandler?: string\n cacheHandlers?: NextConfigComplete['cacheHandlers']\n cacheLifeProfiles?: {\n [profile: string]: import('../../server/use-cache/cache-life').CacheLife\n }\n cacheMaxMemorySize: number\n requestHeaders: IncrementalCache['requestHeaders']\n nextConfigOutput: 'standalone' | 'export' | undefined\n ComponentMod: AppPageModule | AppRouteModule\n isRoutePPREnabled: boolean\n buildId: string\n rootParamKeys: readonly string[]\n}): Promise<StaticPathsResult> {\n if (\n segments.some((generate) => generate.config?.dynamicParams === true) &&\n nextConfigOutput === 'export'\n ) {\n throw new Error(\n '\"dynamicParams: true\" cannot be used with \"output: export\". See more info here: https://nextjs.org/docs/app/building-your-application/deploying/static-exports'\n )\n }\n\n ComponentMod.patchFetch()\n\n const incrementalCache = await createIncrementalCache({\n dir,\n distDir,\n cacheHandler,\n cacheHandlers,\n requestHeaders,\n fetchCacheKeyPrefix,\n flushToDisk: isrFlushToDisk,\n cacheMaxMemorySize,\n })\n\n const childrenRouteParamSegments: Array<{\n readonly name: string\n readonly paramName: string\n readonly paramType: DynamicParamTypes\n }> = []\n\n // These are all the parallel fallback route params that will be included when\n // we're emitting the route for the base route.\n const parallelFallbackRouteParams: FallbackRouteParam[] = []\n\n // First pass: collect all non-parallel route param names.\n // This allows us to filter out parallel route params that duplicate non-parallel ones.\n const nonParallelParamNames = new Set<string>()\n for (const segment of segments) {\n if (!segment.paramName || !segment.paramType) continue\n if (!segment.isParallelRouteSegment) {\n nonParallelParamNames.add(segment.paramName)\n }\n }\n\n // Second pass: collect segments, ensuring non-parallel route params take precedence.\n for (const segment of segments) {\n // If this segment doesn't have a param name then it's not param that we\n // need to resolve.\n if (!segment.paramName || !segment.paramType) continue\n\n if (segment.isParallelRouteSegment) {\n // Skip parallel route params that are already defined as non-parallel route params.\n // Non-parallel route params take precedence because they appear in the URL pathname.\n if (nonParallelParamNames.has(segment.paramName)) {\n continue\n }\n\n // Collect parallel fallback route params for the base route.\n // The actual parallel route param resolution is now handled by\n // resolveParallelRouteParams using the loader tree.\n parallelFallbackRouteParams.push(\n createFallbackRouteParam(segment.paramName, segment.paramType, true)\n )\n } else {\n // Collect all the route param keys that are not parallel route params.\n // These are the ones that will be included in the request pathname.\n childrenRouteParamSegments.push({\n name: segment.name,\n paramName: segment.paramName,\n paramType: segment.paramType,\n })\n }\n }\n\n const afterRunner = new AfterRunner()\n\n const store = createWorkStore({\n page,\n renderOpts: {\n incrementalCache,\n cacheLifeProfiles,\n supportsDynamicResponse: true,\n cacheComponents,\n experimental: {\n authInterrupts,\n },\n waitUntil: afterRunner.context.waitUntil,\n onClose: afterRunner.context.onClose,\n onAfterTaskError: afterRunner.context.onTaskError,\n },\n buildId,\n previouslyRevalidatedTags: [],\n })\n\n const routeParams = await ComponentMod.workAsyncStorage.run(\n store,\n generateRouteStaticParams,\n segments,\n store,\n isRoutePPREnabled\n )\n\n await afterRunner.executeAfter()\n\n let lastDynamicSegmentHadGenerateStaticParams = false\n for (const segment of segments) {\n // Check to see if there are any missing params for segments that have\n // dynamicParams set to false.\n if (\n segment.paramName &&\n segment.isDynamicSegment &&\n segment.config?.dynamicParams === false\n ) {\n for (const params of routeParams) {\n if (segment.paramName in params) continue\n\n const relative = segment.filePath\n ? path.relative(dir, segment.filePath)\n : undefined\n\n throw new Error(\n `Segment \"${relative}\" exports \"dynamicParams: false\" but the param \"${segment.paramName}\" is missing from the generated route params.`\n )\n }\n }\n\n if (\n segment.isDynamicSegment &&\n typeof segment.generateStaticParams !== 'function'\n ) {\n lastDynamicSegmentHadGenerateStaticParams = false\n } else if (typeof segment.generateStaticParams === 'function') {\n lastDynamicSegmentHadGenerateStaticParams = true\n }\n }\n\n // Determine if all the segments have had their parameters provided.\n const hadAllParamsGenerated =\n childrenRouteParamSegments.length === 0 ||\n (routeParams.length > 0 &&\n routeParams.every((params) => {\n for (const { paramName } of childrenRouteParamSegments) {\n if (paramName in params) continue\n return false\n }\n return true\n }))\n\n // TODO: dynamic params should be allowed to be granular per segment but\n // we need additional information stored/leveraged in the prerender\n // manifest to allow this behavior.\n const dynamicParams = segments.every(\n (segment) => segment.config?.dynamicParams !== false\n )\n\n const supportsRoutePreGeneration =\n hadAllParamsGenerated || process.env.NODE_ENV === 'production'\n\n const fallbackMode = dynamicParams\n ? supportsRoutePreGeneration\n ? isRoutePPREnabled\n ? FallbackMode.PRERENDER\n : FallbackMode.BLOCKING_STATIC_RENDER\n : undefined\n : FallbackMode.NOT_FOUND\n\n const prerenderedRoutesByPathname = new Map<string, PrerenderedRoute>()\n\n // Convert rootParamKeys to Set for O(1) lookup.\n const rootParamSet = new Set(rootParamKeys)\n\n if (hadAllParamsGenerated || isRoutePPREnabled) {\n let paramsToProcess = routeParams\n\n if (isRoutePPREnabled) {\n // Discover all unique combinations of the routeParams so we can generate\n // routes that won't throw on empty static shell for each of them if\n // they're available.\n paramsToProcess = generateAllParamCombinations(\n childrenRouteParamSegments,\n routeParams,\n rootParamKeys\n )\n\n // The fallback route params for this route is a combination of the\n // parallel route params and the non-parallel route params.\n const fallbackRouteParams: readonly FallbackRouteParam[] = [\n ...childrenRouteParamSegments.map(({ paramName, paramType: type }) =>\n createFallbackRouteParam(paramName, type, false)\n ),\n ...parallelFallbackRouteParams,\n ]\n\n // Add the base route, this is the route with all the placeholders as it's\n // derived from the `page` string.\n prerenderedRoutesByPathname.set(page, {\n params: {},\n pathname: page,\n encodedPathname: page,\n fallbackRouteParams,\n fallbackMode: calculateFallbackMode(\n dynamicParams,\n rootParamKeys,\n fallbackMode\n ),\n fallbackRootParams: rootParamKeys,\n throwOnEmptyStaticShell: true,\n })\n }\n\n filterUniqueParams(\n childrenRouteParamSegments,\n validateParams(\n page,\n isRoutePPREnabled,\n childrenRouteParamSegments,\n rootParamKeys,\n paramsToProcess\n )\n ).forEach((params) => {\n let pathname = page\n let encodedPathname = page\n\n const fallbackRouteParams: FallbackRouteParam[] = []\n\n for (const {\n paramName: key,\n paramType: type,\n } of childrenRouteParamSegments) {\n const paramValue = params[key]\n\n if (!paramValue) {\n if (isRoutePPREnabled) {\n // Mark remaining params as fallback params.\n fallbackRouteParams.push(createFallbackRouteParam(key, type, false))\n for (\n let i =\n childrenRouteParamSegments.findIndex(\n (param) => param.paramName === key\n ) + 1;\n i < childrenRouteParamSegments.length;\n i++\n ) {\n fallbackRouteParams.push(\n createFallbackRouteParam(\n childrenRouteParamSegments[i].paramName,\n childrenRouteParamSegments[i].paramType,\n false\n )\n )\n }\n break\n } else {\n // This route is not complete, and we aren't performing a partial\n // prerender, so we should return, skipping this route.\n return\n }\n }\n\n const segment = childrenRouteParamSegments.find(\n ({ paramName }) => paramName === key\n )\n if (!segment) {\n throw new InvariantError(\n `Param ${key} not found in childrenRouteParamSegments ${childrenRouteParamSegments.map(({ paramName }) => paramName).join(', ')}`\n )\n }\n\n pathname = pathname.replace(\n segment.name,\n encodeParam(paramValue, (value) => escapePathDelimiters(value, true))\n )\n encodedPathname = encodedPathname.replace(\n segment.name,\n encodeParam(paramValue, encodeURIComponent)\n )\n }\n\n // Resolve parallel route params from the loader tree if this is from an\n // app page.\n if (\n 'loaderTree' in ComponentMod.routeModule.userland &&\n Array.isArray(ComponentMod.routeModule.userland.loaderTree)\n ) {\n resolveParallelRouteParams(\n ComponentMod.routeModule.userland.loaderTree,\n params,\n pathname,\n fallbackRouteParams\n )\n }\n\n const fallbackRootParams: string[] = []\n for (const { paramName, isParallelRouteParam } of fallbackRouteParams) {\n // Only add the param to the fallback root params if it's not a\n // parallel route param. They won't contribute to the request pathname.\n if (isParallelRouteParam) continue\n\n // If the param is a root param then we can add it to the fallback\n // root params.\n if (rootParamSet.has(paramName)) {\n fallbackRootParams.push(paramName)\n }\n }\n\n pathname = normalizePathname(pathname)\n\n prerenderedRoutesByPathname.set(pathname, {\n params,\n pathname,\n encodedPathname: normalizePathname(encodedPathname),\n fallbackRouteParams,\n fallbackMode: calculateFallbackMode(\n dynamicParams,\n fallbackRootParams,\n fallbackMode\n ),\n fallbackRootParams,\n throwOnEmptyStaticShell: true,\n })\n })\n }\n\n const prerenderedRoutes =\n prerenderedRoutesByPathname.size > 0 ||\n lastDynamicSegmentHadGenerateStaticParams\n ? [...prerenderedRoutesByPathname.values()]\n : undefined\n\n // Now we have to set the throwOnEmptyStaticShell for each of the routes.\n if (prerenderedRoutes && cacheComponents) {\n assignErrorIfEmpty(prerenderedRoutes, childrenRouteParamSegments)\n }\n\n return { fallbackMode, prerenderedRoutes }\n}\n"],"names":["path","AfterRunner","createWorkStore","FallbackMode","normalizePathname","encodeParam","createFallbackRouteParam","escapePathDelimiters","createIncrementalCache","InvariantError","getParamProperties","getSegmentParam","parseLoaderTree","INTERCEPTION_ROUTE_MARKERS","throwEmptyGenerateStaticParamsError","filterUniqueParams","childrenRouteParams","routeParams","unique","Map","params","key","paramName","paramKey","value","valuePart","Array","isArray","join","undefined","has","set","from","values","generateAllParamCombinations","rootParamKeys","combinations","minIndexForCompleteRootParams","length","rootParamKey","index","findIndex","param","Math","max","i","combination","keyParts","hasAllRootParams","j","routeKey","hasOwnProperty","includes","push","currentKey","calculateFallbackMode","dynamicParams","fallbackRootParams","baseFallbackMode","BLOCKING_STATIC_RENDER","NOT_FOUND","validateParams","page","isRoutePPREnabled","childrenRouteParamSegments","valid","some","Error","item","paramType","repeat","optional","paramValue","assignErrorIfEmpty","prerenderedRoutes","root","children","routes","route","currentNode","valueKey","childNode","get","stack","node","pop","hasChildren","size","minFallbacks","Infinity","r","min","fallbackRouteParams","throwOnEmptyStaticShell","child","resolveParallelRouteParams","loaderTree","pathname","tree","depth","parallelKey","pathSegments","split","filter","Boolean","segment","parallelRoutes","segmentParam","type","isParallelRouteParam","remainingSegments","slice","hasUnknownParam","processedSegments","flatMap","pathSegment","s","nextDepth","isInterceptionRoute","marker","startsWith","isRouteGroup","endsWith","Object","entries","generateRouteStaticParams","segments","store","queue","segmentIndex","currentParams","current","shift","generateStaticParams","config","fetchCache","nextParams","parentParams","result","buildAppStaticPaths","dir","distDir","cacheComponents","authInterrupts","isrFlushToDisk","cacheHandler","cacheLifeProfiles","requestHeaders","cacheHandlers","cacheMaxMemorySize","fetchCacheKeyPrefix","nextConfigOutput","ComponentMod","buildId","generate","patchFetch","incrementalCache","flushToDisk","parallelFallbackRouteParams","nonParallelParamNames","Set","isParallelRouteSegment","add","name","afterRunner","renderOpts","supportsDynamicResponse","experimental","waitUntil","context","onClose","onAfterTaskError","onTaskError","previouslyRevalidatedTags","workAsyncStorage","run","executeAfter","lastDynamicSegmentHadGenerateStaticParams","isDynamicSegment","relative","filePath","hadAllParamsGenerated","every","supportsRoutePreGeneration","process","env","NODE_ENV","fallbackMode","PRERENDER","prerenderedRoutesByPathname","rootParamSet","paramsToProcess","map","encodedPathname","forEach","find","replace","encodeURIComponent","routeModule","userland"],"mappings":"AASA,OAAOA,UAAU,YAAW;AAC5B,SAASC,WAAW,QAAQ,oCAAmC;AAC/D,SAASC,eAAe,QAAQ,wCAAuC;AACvE,SAASC,YAAY,QAAQ,qBAAoB;AAGjD,SACEC,iBAAiB,EACjBC,WAAW,EACXC,wBAAwB,QACnB,UAAS;AAChB,OAAOC,0BAA0B,uDAAsD;AACvF,SAASC,sBAAsB,QAAQ,gDAA+C;AAItF,SAASC,cAAc,QAAQ,mCAAkC;AACjE,SACEC,kBAAkB,EAClBC,eAAe,QACV,kDAAiD;AACxD,SAASC,eAAe,QAAQ,kDAAiD;AACjF,SAASC,0BAA0B,QAAQ,oDAAmD;AAC9F,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AAM,EAAEnC,SAAS,EAAEuF,oBAAoB,EAAE,IAAIjB,oBAAqB;gBACrE,+DAA+D;gBAC/D,uEAAuE;gBACvE,IAAIiB,sBAAsB;gBAE1B,kEAAkE;gBAClE,eAAe;gBACf,IAAIiF,aAAahK,GAAG,CAACR,YAAY;oBAC/BmC,mBAAmBJ,IAAI,CAAC/B;gBAC1B;YACF;YAEA2E,WAAW7F,kBAAkB6F;YAE7B4F,4BAA4B9J,GAAG,CAACkE,UAAU;gBACxC7E;gBACA6E;gBACAgG,iBAAiB7L,kBAAkB6L;gBACnCrG;gBACA+F,cAAcpI,sBACZC,eACAC,oBACAkI;gBAEFlI;gBACAoC,yBAAyB;YAC3B;QACF;IACF;IAEA,MAAMnB,oBACJmH,4BAA4BtG,IAAI,GAAG,KACnC0F,4CACI;WAAIY,4BAA4B5J,MAAM;KAAG,GACzCJ;IAEN,yEAAyE;IACzE,IAAI6C,qBAAqBoE,iBAAiB;QACxCrE,mBAAmBC,mBAAmBV;IACxC;IAEA,OAAO;QAAE2H;QAAcjH;IAAkB;AAC3C","ignoreList":[0]}
@@ -10,7 +10,7 @@ import { downloadNativeNextSwc, downloadWasmSwc } from '../../lib/download-swc';
10
10
  import { isDeepStrictEqual } from 'util';
11
11
  import { getDefineEnv } from '../define-env';
12
12
  import { throwTurbopackInternalError } from '../../shared/lib/turbopack/internal-error';
13
- const nextVersion = "16.0.1-canary.1";
13
+ const nextVersion = "16.0.1-canary.2";
14
14
  const ArchName = arch();
15
15
  const PlatformName = platform();
16
16
  function infoLog(...args) {