@vercel/next 4.15.21 → 4.15.22

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 -1
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -14260,6 +14260,7 @@ var CORRECT_MIDDLEWARE_ORDER_VERSION = "v12.1.7-canary.29";
14260
14260
  var NEXT_DATA_MIDDLEWARE_RESOLVING_VERSION = "v12.1.7-canary.33";
14261
14261
  var EMPTY_ALLOW_QUERY_FOR_PRERENDERED_VERSION = "v12.2.0";
14262
14262
  var CORRECTED_MANIFESTS_VERSION = "v12.2.0";
14263
+ var DYNAMICALLY_RENDER_404_VERSION = "v16.2.0-canary.17";
14263
14264
  var PRELOAD_CHUNKS = {
14264
14265
  APP_ROUTER_PAGES: [
14265
14266
  ".next/server/webpack-runtime.js",
@@ -14478,6 +14479,10 @@ async function serverBuild({
14478
14479
  nextVersion,
14479
14480
  CORRECTED_MANIFESTS_VERSION
14480
14481
  );
14482
+ const shouldUse404Prerender = import_semver4.default.lt(
14483
+ nextVersion,
14484
+ DYNAMICALLY_RENDER_404_VERSION
14485
+ );
14481
14486
  let hasStatic500 = !!staticPages[import_path5.default.posix.join(entryDirectory, "500")];
14482
14487
  if (lambdaPageKeys.length === 0) {
14483
14488
  throw new import_build_utils2.NowBuildError({
@@ -14680,7 +14685,7 @@ async function serverBuild({
14680
14685
  mode: (await import_fs_extra5.default.lstat(nextServerFile)).mode,
14681
14686
  fsPath: nextServerFile
14682
14687
  });
14683
- if (static404Pages.size > 0) {
14688
+ if (shouldUse404Prerender && static404Pages.size > 0) {
14684
14689
  if (i18n) {
14685
14690
  for (const locale of i18n.locales) {
14686
14691
  const static404Page2 = import_path5.default.posix.join(entryDirectory, locale, "404");
@@ -15105,6 +15110,18 @@ ${JSON.stringify(
15105
15110
  if (manifest === "routes-manifest.json") {
15106
15111
  manifestData.headers = [];
15107
15112
  delete manifestData.deploymentId;
15113
+ } else if (manifest === "server/pages-manifest.json" && !shouldUse404Prerender) {
15114
+ if (manifestData["/404"] === "pages/404.html") {
15115
+ manifestData["/404"] = lambdaPages["404.js"] && !lambdaAppPaths["404.js"] ? "pages/404.js" : "pages/_error.js";
15116
+ }
15117
+ if (i18n) {
15118
+ for (const locale of i18n.locales) {
15119
+ const locale404Key = `/${locale}/404`;
15120
+ if (manifestData[locale404Key] === `pages/${locale}/404.html`) {
15121
+ manifestData[locale404Key] = lambdaPages["404.js"] && !lambdaAppPaths["404.js"] ? `pages/404.js` : "pages/_error.js";
15122
+ }
15123
+ }
15124
+ }
15108
15125
  }
15109
15126
  if (mayFilterManifests) {
15110
15127
  const normalizedPages = new Set(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/next",
3
- "version": "4.15.21",
3
+ "version": "4.15.22",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
@@ -53,7 +53,7 @@
53
53
  "test-listen": "1.1.0",
54
54
  "text-table": "0.2.0",
55
55
  "webpack-sources": "3.2.3",
56
- "@vercel/build-utils": "13.2.16",
56
+ "@vercel/build-utils": "13.3.0",
57
57
  "@vercel/routing-utils": "5.3.2"
58
58
  },
59
59
  "scripts": {