@vercel/next 4.0.14 → 4.0.16

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 (2) hide show
  1. package/dist/index.js +18 -9
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -10364,7 +10364,8 @@ async function getPageLambdaGroups({
10364
10364
  initialPseudoLayerUncompressed,
10365
10365
  lambdaCompressedByteLimit,
10366
10366
  internalPages,
10367
- pageExtensions
10367
+ pageExtensions,
10368
+ inversedAppPathManifest
10368
10369
  }) {
10369
10370
  const groups = [];
10370
10371
  for (const page of pages) {
@@ -10377,9 +10378,12 @@ async function getPageLambdaGroups({
10377
10378
  opts = functionsConfigManifest.functions[routeName];
10378
10379
  }
10379
10380
  if (config && config.functions) {
10381
+ const pageFromManifest = inversedAppPathManifest?.[routeName];
10380
10382
  const sourceFile = await getSourceFilePathFromPage({
10381
10383
  workPath: entryPath,
10382
- page,
10384
+ // since this function is used by both `pages` and `app`, the manifest might not be provided
10385
+ // so fallback to normal behavior of just checking the `page`.
10386
+ page: pageFromManifest ?? page,
10383
10387
  pageExtensions
10384
10388
  });
10385
10389
  const vercelConfigOpts = await (0, import_build_utils.getLambdaOptionsFromFunction)({
@@ -10735,12 +10739,15 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
10735
10739
  throw new Error("Invariant: contentType can't be undefined");
10736
10740
  }
10737
10741
  htmlFsRef = new import_build_utils.FileBlob({ contentType, data: prerender });
10738
- } else if (appDir && !dataRoute && isAppPathRoute && !(isBlocking || isFallback)) {
10742
+ } else if (appDir && !dataRoute && !prefetchDataRoute && isAppPathRoute && !(isBlocking || isFallback)) {
10739
10743
  const contentType = initialHeaders?.["content-type"];
10740
- htmlFsRef = new import_build_utils.FileFsRef({
10741
- fsPath: import_path2.default.join(appDir, `${routeFileNoExt}.body`),
10742
- contentType: contentType || "text/html;charset=utf-8"
10743
- });
10744
+ const fsPath = import_path2.default.join(appDir, `${routeFileNoExt}.body`);
10745
+ if (import_fs_extra3.default.existsSync(fsPath)) {
10746
+ htmlFsRef = new import_build_utils.FileFsRef({
10747
+ fsPath,
10748
+ contentType: contentType || "text/html;charset=utf-8"
10749
+ });
10750
+ }
10744
10751
  } else {
10745
10752
  htmlFsRef = isBlocking || isNotFound && !static404Page ? (
10746
10753
  // Blocking pages do not have an HTML fallback
@@ -12509,7 +12516,8 @@ async function serverBuild({
12509
12516
  lambdaCompressedByteLimit,
12510
12517
  initialPseudoLayerUncompressed: uncompressedInitialSize,
12511
12518
  internalPages,
12512
- pageExtensions
12519
+ pageExtensions,
12520
+ inversedAppPathManifest
12513
12521
  });
12514
12522
  const appRouteHandlersLambdaGroups = await getPageLambdaGroups({
12515
12523
  entryPath: projectDir,
@@ -12525,7 +12533,8 @@ async function serverBuild({
12525
12533
  lambdaCompressedByteLimit,
12526
12534
  initialPseudoLayerUncompressed: uncompressedInitialSize,
12527
12535
  internalPages,
12528
- pageExtensions
12536
+ pageExtensions,
12537
+ inversedAppPathManifest
12529
12538
  });
12530
12539
  for (const group of appRouterLambdaGroups) {
12531
12540
  if (!group.isPrerenders || group.isExperimentalPPR) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/next",
3
- "version": "4.0.14",
3
+ "version": "4.0.16",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
@@ -30,7 +30,7 @@
30
30
  "@types/semver": "6.0.0",
31
31
  "@types/text-table": "0.2.1",
32
32
  "@types/webpack-sources": "3.2.0",
33
- "@vercel/build-utils": "7.2.3",
33
+ "@vercel/build-utils": "7.4.1",
34
34
  "@vercel/routing-utils": "3.1.0",
35
35
  "async-sema": "3.0.1",
36
36
  "buffer-crc32": "0.2.13",