@vercel/next 4.7.6 → 4.7.8

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 +27 -16
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -11193,7 +11193,9 @@ async function getDynamicRoutes({
11193
11193
  "/",
11194
11194
  entryDirectory,
11195
11195
  prefetchSegmentDataRoute.destination
11196
- ) : prefetchSegmentDataRoute.destination}${routeKeys ? `?${Object.entries(routeKeys).map(([key, value]) => `${value}=$${key}`).join("&")}` : ""}`,
11196
+ ) : prefetchSegmentDataRoute.destination}?${Object.entries(
11197
+ prefetchSegmentDataRoute.routeKeys ?? routeKeys ?? {}
11198
+ ).map(([key, value]) => `${value}=$${key}`).join("&")}`,
11197
11199
  check: true
11198
11200
  });
11199
11201
  }
@@ -13988,6 +13990,11 @@ async function serverBuild({
13988
13990
  // We don't want to perform the actual rewrite here, instead we want
13989
13991
  // to just add the headers associated with the rewrite.
13990
13992
  dest: void 0,
13993
+ // We don't want to check here, so omit the check property but we do
13994
+ // want to maintain the order of the rewrites, so add the continue
13995
+ // property.
13996
+ check: void 0,
13997
+ continue: true,
13991
13998
  has,
13992
13999
  headers: headers2
13993
14000
  };
@@ -14036,6 +14043,7 @@ async function serverBuild({
14036
14043
  const lstatSema = new import_async_sema2.Sema(25);
14037
14044
  const lstatResults = {};
14038
14045
  const nonLambdaSsgPages = /* @__PURE__ */ new Set();
14046
+ const static404Pages = new Set(static404Page ? [static404Page] : []);
14039
14047
  Object.keys(prerenderManifest.staticRoutes).forEach((route) => {
14040
14048
  const result = onPrerenderRouteInitial(
14041
14049
  prerenderManifest,
@@ -14048,6 +14056,7 @@ async function serverBuild({
14048
14056
  appDir
14049
14057
  );
14050
14058
  if (result && result.static404Page) {
14059
+ static404Pages.add(result.static404Page);
14051
14060
  static404Page = result.static404Page;
14052
14061
  }
14053
14062
  if (result && result.static500Page) {
@@ -14209,27 +14218,29 @@ async function serverBuild({
14209
14218
  mode: (await import_fs_extra5.default.lstat(nextServerFile)).mode,
14210
14219
  fsPath: nextServerFile
14211
14220
  });
14212
- if (static404Page) {
14221
+ if (static404Pages.size > 0) {
14213
14222
  if (i18n) {
14214
14223
  for (const locale of i18n.locales) {
14215
- let static404File = staticPages[import_path4.default.posix.join(entryDirectory, locale, "/404")];
14216
- if (!static404File) {
14224
+ const static404Page2 = import_path4.default.posix.join(entryDirectory, locale, "404");
14225
+ static404Pages.add(static404Page2);
14226
+ }
14227
+ }
14228
+ for (const static404Page2 of static404Pages) {
14229
+ let static404File = staticPages[static404Page2];
14230
+ if (!static404File) {
14231
+ const static404FilePath = import_path4.default.join(
14232
+ pagesDir,
14233
+ `${static404Page2}.html`
14234
+ );
14235
+ if (import_fs_extra5.default.existsSync(static404FilePath)) {
14217
14236
  static404File = new import_build_utils2.FileFsRef({
14218
- fsPath: import_path4.default.join(pagesDir, locale, "/404.html")
14237
+ fsPath: static404FilePath
14219
14238
  });
14220
- if (!import_fs_extra5.default.existsSync(static404File.fsPath)) {
14221
- static404File = new import_build_utils2.FileFsRef({
14222
- fsPath: import_path4.default.join(pagesDir, "/404.html")
14223
- });
14224
- }
14225
14239
  }
14240
+ }
14241
+ if (static404File) {
14226
14242
  requiredFiles[import_path4.default.relative(baseDir, static404File.fsPath)] = static404File;
14227
14243
  }
14228
- } else {
14229
- const static404File = staticPages[static404Page] || new import_build_utils2.FileFsRef({
14230
- fsPath: import_path4.default.join(pagesDir, "/404.html")
14231
- });
14232
- requiredFiles[import_path4.default.relative(baseDir, static404File.fsPath)] = static404File;
14233
14244
  }
14234
14245
  }
14235
14246
  const envFiles = [];
@@ -16057,7 +16068,7 @@ var build = async (buildOptions) => {
16057
16068
  if (!nextVersion) {
16058
16069
  throw new import_build_utils3.NowBuildError({
16059
16070
  code: "NEXT_NO_VERSION",
16060
- message: 'No Next.js version could be detected in your project. Make sure `"next"` is installed in "dependencies" or "devDependencies"'
16071
+ message: 'No Next.js version detected. Make sure your package.json has "next" in either "dependencies" or "devDependencies". Also check your Root Directory setting matches the directory of your package.json file.'
16061
16072
  });
16062
16073
  }
16063
16074
  let isServerMode = !(config.framework === "blitzjs") && import_semver4.default.gte(nextVersion, SERVER_BUILD_MINIMUM_NEXT_VERSION);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/next",
3
- "version": "4.7.6",
3
+ "version": "4.7.8",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",