@vercel/next 4.15.10 → 4.15.11

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 +47 -6
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -2265,9 +2265,9 @@ var require_graceful_fs = __commonJS({
2265
2265
  }
2266
2266
  }
2267
2267
  var fs$readdir = fs6.readdir;
2268
- fs6.readdir = readdir;
2268
+ fs6.readdir = readdir2;
2269
2269
  var noReaddirOptionVersions = /^v[0-5]\./;
2270
- function readdir(path6, options, cb) {
2270
+ function readdir2(path6, options, cb) {
2271
2271
  if (typeof options === "function")
2272
2272
  cb = options, options = null;
2273
2273
  var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path7, options2, cb2, startTime) {
@@ -11334,7 +11334,13 @@ async function getRoutesManifest(entryPath, outputDirectory, nextVersion) {
11334
11334
  const hasRoutesManifest = await import_fs_extra3.default.access(pathRoutesManifest).then(() => true).catch(() => false);
11335
11335
  if (shouldHaveManifest && !hasRoutesManifest) {
11336
11336
  throw new import_build_utils.NowBuildError({
11337
- message: `The file "${pathRoutesManifest}" couldn't be found. This is often caused by a misconfiguration in your project.`,
11337
+ message: `The file "${pathRoutesManifest}" couldn't be found. This is usually caused by one of the following:
11338
+
11339
+ 1. The "Output Directory" setting in your project is misconfigured. Ensure it matches your Next.js "distDir" configuration (defaults to ".next").
11340
+
11341
+ 2. If using Turborepo, ensure your task outputs include the Next.js build directory. Add ".next/**" (or your custom distDir) to the "outputs" array in turbo.json for the build task.
11342
+
11343
+ 3. The build command did not complete successfully. Check the build logs above for errors.`,
11338
11344
  link: "https://err.sh/vercel/vercel/now-next-routes-manifest",
11339
11345
  code: "NEXT_NO_ROUTES_MANIFEST"
11340
11346
  });
@@ -16696,7 +16702,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
16696
16702
  let buildOutputVersion;
16697
16703
  try {
16698
16704
  const data = await (0, import_fs_extra6.readJSON)(
16699
- import_path6.default.join(outputDirectory, "output/config.json")
16705
+ import_path6.default.join(entryPath, outputDirectory, "output/config.json")
16700
16706
  );
16701
16707
  buildOutputVersion = data.version;
16702
16708
  } catch (_) {
@@ -16707,6 +16713,35 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
16707
16713
  buildOutputVersion
16708
16714
  };
16709
16715
  }
16716
+ const absoluteOutputDirectory = import_path6.default.join(entryPath, outputDirectory);
16717
+ const outputDirExists = await (0, import_fs_extra6.pathExists)(absoluteOutputDirectory);
16718
+ if (!outputDirExists) {
16719
+ throw new import_build_utils3.NowBuildError({
16720
+ code: "NEXT_OUTPUT_DIR_MISSING",
16721
+ message: `The Next.js output directory "${outputDirectory}" was not found at "${absoluteOutputDirectory}". This is usually caused by one of the following:
16722
+
16723
+ 1. The "Output Directory" setting in your project is misconfigured. Check your project settings and ensure the output directory matches your Next.js configuration.
16724
+
16725
+ 2. If using Turborepo, ensure your task outputs include the Next.js build directory. Add "${outputDirectory}/**" to the "outputs" array in your turbo.json for the build task.
16726
+
16727
+ 3. The build command did not complete successfully. Check the build logs above for errors.`,
16728
+ link: "https://err.sh/vercel/vercel/now-next-routes-manifest"
16729
+ });
16730
+ }
16731
+ const outputDirContents = await (0, import_fs_extra6.readdir)(absoluteOutputDirectory);
16732
+ if (outputDirContents.length === 0) {
16733
+ throw new import_build_utils3.NowBuildError({
16734
+ code: "NEXT_OUTPUT_DIR_EMPTY",
16735
+ message: `The Next.js output directory "${outputDirectory}" exists but is empty. This is usually caused by one of the following:
16736
+
16737
+ 1. If using Turborepo, ensure your task outputs include the Next.js build directory. Add "${outputDirectory}/**" to the "outputs" array in your turbo.json for the build task.
16738
+
16739
+ 2. The build command did not generate any output. Check the build logs above for errors.
16740
+
16741
+ 3. A previous build step may have cleared the output directory.`,
16742
+ link: "https://err.sh/vercel/vercel/now-next-routes-manifest"
16743
+ });
16744
+ }
16710
16745
  let appMountPrefixNoTrailingSlash = import_path6.default.posix.join("/", entryDirectory).replace(/\/+$/, "");
16711
16746
  const requiredServerFilesManifest = isServerMode ? await getRequiredServerFilesManifest(entryPath, outputDirectory) : false;
16712
16747
  isServerMode = Boolean(requiredServerFilesManifest);
@@ -16762,6 +16797,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
16762
16797
  let hasPages404 = false;
16763
16798
  let buildId = "";
16764
16799
  let escapedBuildId = "";
16800
+ let deploymentId;
16765
16801
  if (isLegacy || isSharedLambdas || isServerMode) {
16766
16802
  try {
16767
16803
  buildId = await (0, import_fs_extra6.readFile)(
@@ -16776,6 +16812,9 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
16776
16812
  });
16777
16813
  }
16778
16814
  }
16815
+ if (routesManifest?.deploymentId) {
16816
+ deploymentId = routesManifest.deploymentId;
16817
+ }
16779
16818
  if (routesManifest) {
16780
16819
  switch (routesManifest.version) {
16781
16820
  case 1:
@@ -17078,7 +17117,8 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
17078
17117
  }
17079
17118
  ] : []
17080
17119
  ],
17081
- framework: { version: nextVersion }
17120
+ framework: { version: nextVersion },
17121
+ ...deploymentId && { deploymentId }
17082
17122
  };
17083
17123
  }
17084
17124
  if (isLegacy) {
@@ -18440,7 +18480,8 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
18440
18480
  ]
18441
18481
  ]
18442
18482
  ],
18443
- framework: { version: nextVersion }
18483
+ framework: { version: nextVersion },
18484
+ ...deploymentId && { deploymentId }
18444
18485
  };
18445
18486
  };
18446
18487
  var diagnostics = async ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/next",
3
- "version": "4.15.10",
3
+ "version": "4.15.11",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
@@ -52,8 +52,8 @@
52
52
  "test-listen": "1.1.0",
53
53
  "text-table": "0.2.0",
54
54
  "webpack-sources": "3.2.3",
55
- "@vercel/build-utils": "13.2.4",
56
- "@vercel/routing-utils": "5.3.1"
55
+ "@vercel/build-utils": "13.2.5",
56
+ "@vercel/routing-utils": "5.3.2"
57
57
  },
58
58
  "scripts": {
59
59
  "build": "node build.mjs",