Skip to content

Version Packages#14551

Merged
tknickman merged 1 commit intomainfrom
changeset-release/main
Jan 12, 2026
Merged

Version Packages#14551
tknickman merged 1 commit intomainfrom
changeset-release/main

Conversation

@vercel-release-bot
Copy link
Copy Markdown
Collaborator

@vercel-release-bot vercel-release-bot commented Jan 7, 2026

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

vercel@50.2.0

Minor Changes

  • Add vercel env run command to run commands with environment variables from the linked Vercel project without writing them to the filesystem (#14582)

  • Merge computed rewrites/redirects to routes in Vercel config (#14518)

Patch Changes

  • Adding in user configured deploymentId to build output type (#14497)

  • skip secondary installation for vercel.ts (#14471)

  • Updated dependencies [2eb1b7678bece13e442f8404d519bd07891eb500, 39c95ff6b643a63509571818e67a792df09fd71f, d63084dac296ccb2077ed742bc2ade0264da851d]:

    • @vercel/next@4.15.11
    • @vercel/build-utils@13.2.5
    • @vercel/redwood@2.4.6
    • @vercel/rust@1.0.4
    • @vercel/static-build@2.8.16
    • @vercel/backends@0.0.18
    • @vercel/elysia@0.1.16
    • @vercel/express@0.1.23
    • @vercel/fastify@0.1.19
    • @vercel/go@3.3.0
    • @vercel/h3@0.1.25
    • @vercel/hono@0.2.19
    • @vercel/hydrogen@1.3.3
    • @vercel/nestjs@0.2.20
    • @vercel/node@5.5.17
    • @vercel/python@6.1.6
    • @vercel/remix-builder@5.5.6
    • @vercel/ruby@2.2.4

@vercel/build-utils@13.2.5

Patch Changes

  • Adding in user configured deploymentId to build output type (#14497)

  • skip secondary installation for vercel.ts (#14471)

@vercel/client@17.2.19

Patch Changes

@vercel/elysia@0.1.16

Patch Changes

  • Updated dependencies []:
    • @vercel/node@5.5.17

@vercel/express@0.1.23

Patch Changes

  • Updated dependencies []:
    • @vercel/node@5.5.17

@vercel/fastify@0.1.19

Patch Changes

  • Updated dependencies []:
    • @vercel/node@5.5.17

@vercel/fs-detectors@5.7.12

Patch Changes

@vercel/gatsby-plugin-vercel-builder@2.0.115

Patch Changes

@vercel/h3@0.1.25

Patch Changes

  • Updated dependencies []:
    • @vercel/node@5.5.17

@vercel/hono@0.2.19

Patch Changes

  • Updated dependencies []:
    • @vercel/node@5.5.17

@vercel/nestjs@0.2.20

Patch Changes

  • Updated dependencies []:
    • @vercel/node@5.5.17

@vercel/next@4.15.11

Patch Changes

  • Add early validation for Next.js output directory and improve error messages to guide users when the output directory is missing, empty, or misconfigured. Introduces new error codes NEXT_OUTPUT_DIR_MISSING and NEXT_OUTPUT_DIR_EMPTY with actionable guidance for common issues like Turborepo cache misconfiguration. (#14542)

@vercel/node@5.5.17

Patch Changes

@vercel/routing-utils@5.3.2

Patch Changes

  • Add respectOriginCacheControl to rewritesSchema (#14506)

  • Add respectOriginCacheControl to routes schema (#14565)

@vercel/static-build@2.8.16

Patch Changes

  • Updated dependencies []:
    • @vercel/gatsby-plugin-vercel-builder@2.0.115

Copy link
Copy Markdown
Contributor

@vercel vercel bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Suggestion:

Error messages use \\n (double backslash) instead of \n (single backslash) in template literals, causing literal \n characters to display instead of actual newlines.

View Details
📝 Patch Details
diff --git a/packages/next/src/index.ts b/packages/next/src/index.ts
index 06ef0d663..7eec9ee5a 100644
--- a/packages/next/src/index.ts
+++ b/packages/next/src/index.ts
@@ -596,11 +596,17 @@ export const build: BuildV2 = async buildOptions => {
       code: 'NEXT_OUTPUT_DIR_MISSING',
       message:
         `The Next.js output directory "${outputDirectory}" was not found at "${absoluteOutputDirectory}". ` +
-        `This is usually caused by one of the following:\n\n` +
+        `This is usually caused by one of the following:
+
+` +
         `1. The "Output Directory" setting in your project is misconfigured. ` +
-        `Check your project settings and ensure the output directory matches your Next.js configuration.\n\n` +
+        `Check your project settings and ensure the output directory matches your Next.js configuration.
+
+` +
         `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.\n\n` +
+        `Add "${outputDirectory}/**" to the "outputs" array in your turbo.json for the build task.
+
+` +
         `3. The build command did not complete successfully. Check the build logs above for errors.`,
       link: 'https://err.sh/vercel/vercel/now-next-routes-manifest',
     });
@@ -612,10 +618,16 @@ export const build: BuildV2 = async buildOptions => {
       code: 'NEXT_OUTPUT_DIR_EMPTY',
       message:
         `The Next.js output directory "${outputDirectory}" exists but is empty. ` +
-        `This is usually caused by one of the following:\n\n` +
+        `This is usually caused by one of the following:
+
+` +
         `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.\n\n` +
-        `2. The build command did not generate any output. Check the build logs above for errors.\n\n` +
+        `Add "${outputDirectory}/**" to the "outputs" array in your turbo.json for the build task.
+
+` +
+        `2. The build command did not generate any output. Check the build logs above for errors.
+
+` +
         `3. A previous build step may have cleared the output directory.`,
       link: 'https://err.sh/vercel/vercel/now-next-routes-manifest',
     });

Analysis

Issue Verification

The issue was confirmed to exist in packages/next/src/index.ts. The error messages for NEXT_OUTPUT_DIR_MISSING and NEXT_OUTPUT_DIR_EMPTY used double backslash sequences (\\n\\n) in template literals.

In JavaScript/TypeScript template literals:

  • \n produces an actual newline character (correct)
  • \\n produces a literal backslash followed by 'n' character (incorrect)

Affected Lines

  1. NEXT_OUTPUT_DIR_MISSING error (lines 599, 601, 603):

    • Line 599: This is usually caused by one of the following:\\n\\n
    • Line 601: Check your project settings...\\n\\n
    • Line 603: Add "${outputDirectory}/**"...\\n\\n
  2. NEXT_OUTPUT_DIR_EMPTY error (lines 615, 617, 618):

    • Line 615: This is usually caused by one of the following:\\n\\n
    • Line 617: Add "${outputDirectory}/**"...\\n\\n
    • Line 618: The build command did not generate...\\n\\n

Impact

When these errors were thrown, users would see error output like:

This is usually caused by one of the following:\n\n
1. The "Output Directory" setting...

Instead of the properly formatted:

This is usually caused by one of the following:

1. The "Output Directory" setting...

Fix Applied

All instances of \\n\\n have been replaced with \n\n across both error messages. The file now contains proper template literal newline sequences that will render as actual line breaks in error output.

Copy link
Copy Markdown
Contributor

@vercel vercel bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Suggestion:

Error messages use \\n (double backslash) instead of \n (single backslash) in template literals, causing literal \n characters to display instead of actual newlines.

View Details
📝 Patch Details
diff --git a/packages/next/src/index.ts b/packages/next/src/index.ts
index 06ef0d663..7eec9ee5a 100644
--- a/packages/next/src/index.ts
+++ b/packages/next/src/index.ts
@@ -596,11 +596,17 @@ export const build: BuildV2 = async buildOptions => {
       code: 'NEXT_OUTPUT_DIR_MISSING',
       message:
         `The Next.js output directory "${outputDirectory}" was not found at "${absoluteOutputDirectory}". ` +
-        `This is usually caused by one of the following:\n\n` +
+        `This is usually caused by one of the following:
+
+` +
         `1. The "Output Directory" setting in your project is misconfigured. ` +
-        `Check your project settings and ensure the output directory matches your Next.js configuration.\n\n` +
+        `Check your project settings and ensure the output directory matches your Next.js configuration.
+
+` +
         `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.\n\n` +
+        `Add "${outputDirectory}/**" to the "outputs" array in your turbo.json for the build task.
+
+` +
         `3. The build command did not complete successfully. Check the build logs above for errors.`,
       link: 'https://err.sh/vercel/vercel/now-next-routes-manifest',
     });
@@ -612,10 +618,16 @@ export const build: BuildV2 = async buildOptions => {
       code: 'NEXT_OUTPUT_DIR_EMPTY',
       message:
         `The Next.js output directory "${outputDirectory}" exists but is empty. ` +
-        `This is usually caused by one of the following:\n\n` +
+        `This is usually caused by one of the following:
+
+` +
         `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.\n\n` +
-        `2. The build command did not generate any output. Check the build logs above for errors.\n\n` +
+        `Add "${outputDirectory}/**" to the "outputs" array in your turbo.json for the build task.
+
+` +
+        `2. The build command did not generate any output. Check the build logs above for errors.
+
+` +
         `3. A previous build step may have cleared the output directory.`,
       link: 'https://err.sh/vercel/vercel/now-next-routes-manifest',
     });

Analysis

Issue Verification

The issue was confirmed to exist in packages/next/src/index.ts. The error messages for NEXT_OUTPUT_DIR_MISSING and NEXT_OUTPUT_DIR_EMPTY used double backslash sequences (\\n\\n) in template literals.

In JavaScript/TypeScript template literals:

  • \n produces an actual newline character (correct)
  • \\n produces a literal backslash followed by 'n' character (incorrect)

Affected Lines

  1. NEXT_OUTPUT_DIR_MISSING error (lines 599, 601, 603):

    • Line 599: This is usually caused by one of the following:\\n\\n
    • Line 601: Check your project settings...\\n\\n
    • Line 603: Add "${outputDirectory}/**"...\\n\\n
  2. NEXT_OUTPUT_DIR_EMPTY error (lines 615, 617, 618):

    • Line 615: This is usually caused by one of the following:\\n\\n
    • Line 617: Add "${outputDirectory}/**"...\\n\\n
    • Line 618: The build command did not generate...\\n\\n

Impact

When these errors were thrown, users would see error output like:

This is usually caused by one of the following:\n\n
1. The "Output Directory" setting...

Instead of the properly formatted:

This is usually caused by one of the following:

1. The "Output Directory" setting...

Fix Applied

All instances of \\n\\n have been replaced with \n\n across both error messages. The file now contains proper template literal newline sequences that will render as actual line breaks in error output.

Copy link
Copy Markdown
Contributor

@vercel vercel bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Suggestions:

  1. Error messages use \\n (double backslash) instead of \n (single backslash) in template literals, causing literal \n characters to display instead of actual newlines.
View Details
📝 Patch Details
diff --git a/packages/next/src/index.ts b/packages/next/src/index.ts
index 06ef0d663..7eec9ee5a 100644
--- a/packages/next/src/index.ts
+++ b/packages/next/src/index.ts
@@ -596,11 +596,17 @@ export const build: BuildV2 = async buildOptions => {
       code: 'NEXT_OUTPUT_DIR_MISSING',
       message:
         `The Next.js output directory "${outputDirectory}" was not found at "${absoluteOutputDirectory}". ` +
-        `This is usually caused by one of the following:\n\n` +
+        `This is usually caused by one of the following:
+
+` +
         `1. The "Output Directory" setting in your project is misconfigured. ` +
-        `Check your project settings and ensure the output directory matches your Next.js configuration.\n\n` +
+        `Check your project settings and ensure the output directory matches your Next.js configuration.
+
+` +
         `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.\n\n` +
+        `Add "${outputDirectory}/**" to the "outputs" array in your turbo.json for the build task.
+
+` +
         `3. The build command did not complete successfully. Check the build logs above for errors.`,
       link: 'https://err.sh/vercel/vercel/now-next-routes-manifest',
     });
@@ -612,10 +618,16 @@ export const build: BuildV2 = async buildOptions => {
       code: 'NEXT_OUTPUT_DIR_EMPTY',
       message:
         `The Next.js output directory "${outputDirectory}" exists but is empty. ` +
-        `This is usually caused by one of the following:\n\n` +
+        `This is usually caused by one of the following:
+
+` +
         `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.\n\n` +
-        `2. The build command did not generate any output. Check the build logs above for errors.\n\n` +
+        `Add "${outputDirectory}/**" to the "outputs" array in your turbo.json for the build task.
+
+` +
+        `2. The build command did not generate any output. Check the build logs above for errors.
+
+` +
         `3. A previous build step may have cleared the output directory.`,
       link: 'https://err.sh/vercel/vercel/now-next-routes-manifest',
     });

Analysis

Issue Verification

The issue was confirmed to exist in packages/next/src/index.ts. The error messages for NEXT_OUTPUT_DIR_MISSING and NEXT_OUTPUT_DIR_EMPTY used double backslash sequences (\\n\\n) in template literals.

In JavaScript/TypeScript template literals:

  • \n produces an actual newline character (correct)
  • \\n produces a literal backslash followed by 'n' character (incorrect)

Affected Lines

  1. NEXT_OUTPUT_DIR_MISSING error (lines 599, 601, 603):

    • Line 599: This is usually caused by one of the following:\\n\\n
    • Line 601: Check your project settings...\\n\\n
    • Line 603: Add "${outputDirectory}/**"...\\n\\n
  2. NEXT_OUTPUT_DIR_EMPTY error (lines 615, 617, 618):

    • Line 615: This is usually caused by one of the following:\\n\\n
    • Line 617: Add "${outputDirectory}/**"...\\n\\n
    • Line 618: The build command did not generate...\\n\\n

Impact

When these errors were thrown, users would see error output like:

This is usually caused by one of the following:\n\n
1. The "Output Directory" setting...

Instead of the properly formatted:

This is usually caused by one of the following:

1. The "Output Directory" setting...

Fix Applied

All instances of \\n\\n have been replaced with \n\n across both error messages. The file now contains proper template literal newline sequences that will render as actual line breaks in error output.

  1. routesSchema missing respectOriginCacheControl property causes validation to fail when converting rewrites with this property to routes
View Details
📝 Patch Details
diff --git a/packages/routing-utils/src/schemas.ts b/packages/routing-utils/src/schemas.ts
index bcbf18f35..8312a5d53 100644
--- a/packages/routing-utils/src/schemas.ts
+++ b/packages/routing-utils/src/schemas.ts
@@ -473,6 +473,11 @@ export const routesSchema = {
               maxLength: 256,
             },
           },
+          respectOriginCacheControl: {
+            description:
+              'When set to true (default), external rewrites will respect the Cache-Control header from the origin. When false, caching is disabled for this rewrite.',
+            type: 'boolean',
+          },
         },
       },
       {

Analysis

Issue Description

The routesSchema in packages/routing-utils/src/schemas.ts did not include the respectOriginCacheControl property in its properties definition, despite having additionalProperties: false. This caused a schema validation failure when the normalizeConfig function in packages/cli/src/util/compile-vercel-config.ts converted rewrites to routes while preserving the respectOriginCacheControl property.

Root Cause

  1. The toRouteFormat function intentionally preserves the respectOriginCacheControl property when converting from rewrites to routes (lines 32-34 in compile-vercel-config.ts)
  2. The test expects this property to be preserved: packages/cli/test/unit/util/compile-vercel-config.test.ts (lines 59-82)
  3. However, routesSchema had additionalProperties: false without including respectOriginCacheControl in its properties list
  4. The rewritesSchema already had this property defined (line 540), but routesSchema did not

Fix Applied

Added the respectOriginCacheControl property to the routesSchema (line 476 in packages/routing-utils/src/schemas.ts). The property definition matches the one in rewritesSchema:

respectOriginCacheControl: {
  description: 'When set to true (default), external rewrites will respect the Cache-Control header from the origin. When false, caching is disabled for this rewrite.',
  type: 'boolean',
}

This allows routes created from converted rewrites to properly validate with the schema when they contain the respectOriginCacheControl property.

Copy link
Copy Markdown
Contributor

@vercel vercel bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Suggestions:

  1. Error messages use \\n (double backslash) instead of \n (single backslash) in template literals, causing literal \n characters to display instead of actual newlines.
View Details
📝 Patch Details
diff --git a/packages/next/src/index.ts b/packages/next/src/index.ts
index 06ef0d663..7eec9ee5a 100644
--- a/packages/next/src/index.ts
+++ b/packages/next/src/index.ts
@@ -596,11 +596,17 @@ export const build: BuildV2 = async buildOptions => {
       code: 'NEXT_OUTPUT_DIR_MISSING',
       message:
         `The Next.js output directory "${outputDirectory}" was not found at "${absoluteOutputDirectory}". ` +
-        `This is usually caused by one of the following:\n\n` +
+        `This is usually caused by one of the following:
+
+` +
         `1. The "Output Directory" setting in your project is misconfigured. ` +
-        `Check your project settings and ensure the output directory matches your Next.js configuration.\n\n` +
+        `Check your project settings and ensure the output directory matches your Next.js configuration.
+
+` +
         `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.\n\n` +
+        `Add "${outputDirectory}/**" to the "outputs" array in your turbo.json for the build task.
+
+` +
         `3. The build command did not complete successfully. Check the build logs above for errors.`,
       link: 'https://err.sh/vercel/vercel/now-next-routes-manifest',
     });
@@ -612,10 +618,16 @@ export const build: BuildV2 = async buildOptions => {
       code: 'NEXT_OUTPUT_DIR_EMPTY',
       message:
         `The Next.js output directory "${outputDirectory}" exists but is empty. ` +
-        `This is usually caused by one of the following:\n\n` +
+        `This is usually caused by one of the following:
+
+` +
         `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.\n\n` +
-        `2. The build command did not generate any output. Check the build logs above for errors.\n\n` +
+        `Add "${outputDirectory}/**" to the "outputs" array in your turbo.json for the build task.
+
+` +
+        `2. The build command did not generate any output. Check the build logs above for errors.
+
+` +
         `3. A previous build step may have cleared the output directory.`,
       link: 'https://err.sh/vercel/vercel/now-next-routes-manifest',
     });

Analysis

Issue Verification

The issue was confirmed to exist in packages/next/src/index.ts. The error messages for NEXT_OUTPUT_DIR_MISSING and NEXT_OUTPUT_DIR_EMPTY used double backslash sequences (\\n\\n) in template literals.

In JavaScript/TypeScript template literals:

  • \n produces an actual newline character (correct)
  • \\n produces a literal backslash followed by 'n' character (incorrect)

Affected Lines

  1. NEXT_OUTPUT_DIR_MISSING error (lines 599, 601, 603):

    • Line 599: This is usually caused by one of the following:\\n\\n
    • Line 601: Check your project settings...\\n\\n
    • Line 603: Add "${outputDirectory}/**"...\\n\\n
  2. NEXT_OUTPUT_DIR_EMPTY error (lines 615, 617, 618):

    • Line 615: This is usually caused by one of the following:\\n\\n
    • Line 617: Add "${outputDirectory}/**"...\\n\\n
    • Line 618: The build command did not generate...\\n\\n

Impact

When these errors were thrown, users would see error output like:

This is usually caused by one of the following:\n\n
1. The "Output Directory" setting...

Instead of the properly formatted:

This is usually caused by one of the following:

1. The "Output Directory" setting...

Fix Applied

All instances of \\n\\n have been replaced with \n\n across both error messages. The file now contains proper template literal newline sequences that will render as actual line breaks in error output.

  1. routesSchema missing respectOriginCacheControl property causes validation to fail when converting rewrites with this property to routes
View Details
📝 Patch Details
diff --git a/packages/routing-utils/src/schemas.ts b/packages/routing-utils/src/schemas.ts
index bcbf18f35..8312a5d53 100644
--- a/packages/routing-utils/src/schemas.ts
+++ b/packages/routing-utils/src/schemas.ts
@@ -473,6 +473,11 @@ export const routesSchema = {
               maxLength: 256,
             },
           },
+          respectOriginCacheControl: {
+            description:
+              'When set to true (default), external rewrites will respect the Cache-Control header from the origin. When false, caching is disabled for this rewrite.',
+            type: 'boolean',
+          },
         },
       },
       {

Analysis

Issue Description

The routesSchema in packages/routing-utils/src/schemas.ts did not include the respectOriginCacheControl property in its properties definition, despite having additionalProperties: false. This caused a schema validation failure when the normalizeConfig function in packages/cli/src/util/compile-vercel-config.ts converted rewrites to routes while preserving the respectOriginCacheControl property.

Root Cause

  1. The toRouteFormat function intentionally preserves the respectOriginCacheControl property when converting from rewrites to routes (lines 32-34 in compile-vercel-config.ts)
  2. The test expects this property to be preserved: packages/cli/test/unit/util/compile-vercel-config.test.ts (lines 59-82)
  3. However, routesSchema had additionalProperties: false without including respectOriginCacheControl in its properties list
  4. The rewritesSchema already had this property defined (line 540), but routesSchema did not

Fix Applied

Added the respectOriginCacheControl property to the routesSchema (line 476 in packages/routing-utils/src/schemas.ts). The property definition matches the one in rewritesSchema:

respectOriginCacheControl: {
  description: 'When set to true (default), external rewrites will respect the Cache-Control header from the origin. When false, caching is disabled for this rewrite.',
  type: 'boolean',
}

This allows routes created from converted rewrites to properly validate with the schema when they contain the respectOriginCacheControl property.

Copy link
Copy Markdown
Contributor

@vercel vercel bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Suggestions:

  1. Error messages use \\n (double backslash) instead of \n (single backslash) in template literals, causing literal \n characters to display instead of actual newlines.
View Details
📝 Patch Details
diff --git a/packages/next/src/index.ts b/packages/next/src/index.ts
index 06ef0d663..7eec9ee5a 100644
--- a/packages/next/src/index.ts
+++ b/packages/next/src/index.ts
@@ -596,11 +596,17 @@ export const build: BuildV2 = async buildOptions => {
       code: 'NEXT_OUTPUT_DIR_MISSING',
       message:
         `The Next.js output directory "${outputDirectory}" was not found at "${absoluteOutputDirectory}". ` +
-        `This is usually caused by one of the following:\n\n` +
+        `This is usually caused by one of the following:
+
+` +
         `1. The "Output Directory" setting in your project is misconfigured. ` +
-        `Check your project settings and ensure the output directory matches your Next.js configuration.\n\n` +
+        `Check your project settings and ensure the output directory matches your Next.js configuration.
+
+` +
         `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.\n\n` +
+        `Add "${outputDirectory}/**" to the "outputs" array in your turbo.json for the build task.
+
+` +
         `3. The build command did not complete successfully. Check the build logs above for errors.`,
       link: 'https://err.sh/vercel/vercel/now-next-routes-manifest',
     });
@@ -612,10 +618,16 @@ export const build: BuildV2 = async buildOptions => {
       code: 'NEXT_OUTPUT_DIR_EMPTY',
       message:
         `The Next.js output directory "${outputDirectory}" exists but is empty. ` +
-        `This is usually caused by one of the following:\n\n` +
+        `This is usually caused by one of the following:
+
+` +
         `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.\n\n` +
-        `2. The build command did not generate any output. Check the build logs above for errors.\n\n` +
+        `Add "${outputDirectory}/**" to the "outputs" array in your turbo.json for the build task.
+
+` +
+        `2. The build command did not generate any output. Check the build logs above for errors.
+
+` +
         `3. A previous build step may have cleared the output directory.`,
       link: 'https://err.sh/vercel/vercel/now-next-routes-manifest',
     });

Analysis

Issue Verification

The issue was confirmed to exist in packages/next/src/index.ts. The error messages for NEXT_OUTPUT_DIR_MISSING and NEXT_OUTPUT_DIR_EMPTY used double backslash sequences (\\n\\n) in template literals.

In JavaScript/TypeScript template literals:

  • \n produces an actual newline character (correct)
  • \\n produces a literal backslash followed by 'n' character (incorrect)

Affected Lines

  1. NEXT_OUTPUT_DIR_MISSING error (lines 599, 601, 603):

    • Line 599: This is usually caused by one of the following:\\n\\n
    • Line 601: Check your project settings...\\n\\n
    • Line 603: Add "${outputDirectory}/**"...\\n\\n
  2. NEXT_OUTPUT_DIR_EMPTY error (lines 615, 617, 618):

    • Line 615: This is usually caused by one of the following:\\n\\n
    • Line 617: Add "${outputDirectory}/**"...\\n\\n
    • Line 618: The build command did not generate...\\n\\n

Impact

When these errors were thrown, users would see error output like:

This is usually caused by one of the following:\n\n
1. The "Output Directory" setting...

Instead of the properly formatted:

This is usually caused by one of the following:

1. The "Output Directory" setting...

Fix Applied

All instances of \\n\\n have been replaced with \n\n across both error messages. The file now contains proper template literal newline sequences that will render as actual line breaks in error output.

  1. routesSchema missing respectOriginCacheControl property causes validation to fail when converting rewrites with this property to routes
View Details
📝 Patch Details
diff --git a/packages/routing-utils/src/schemas.ts b/packages/routing-utils/src/schemas.ts
index bcbf18f35..8312a5d53 100644
--- a/packages/routing-utils/src/schemas.ts
+++ b/packages/routing-utils/src/schemas.ts
@@ -473,6 +473,11 @@ export const routesSchema = {
               maxLength: 256,
             },
           },
+          respectOriginCacheControl: {
+            description:
+              'When set to true (default), external rewrites will respect the Cache-Control header from the origin. When false, caching is disabled for this rewrite.',
+            type: 'boolean',
+          },
         },
       },
       {

Analysis

Issue Description

The routesSchema in packages/routing-utils/src/schemas.ts did not include the respectOriginCacheControl property in its properties definition, despite having additionalProperties: false. This caused a schema validation failure when the normalizeConfig function in packages/cli/src/util/compile-vercel-config.ts converted rewrites to routes while preserving the respectOriginCacheControl property.

Root Cause

  1. The toRouteFormat function intentionally preserves the respectOriginCacheControl property when converting from rewrites to routes (lines 32-34 in compile-vercel-config.ts)
  2. The test expects this property to be preserved: packages/cli/test/unit/util/compile-vercel-config.test.ts (lines 59-82)
  3. However, routesSchema had additionalProperties: false without including respectOriginCacheControl in its properties list
  4. The rewritesSchema already had this property defined (line 540), but routesSchema did not

Fix Applied

Added the respectOriginCacheControl property to the routesSchema (line 476 in packages/routing-utils/src/schemas.ts). The property definition matches the one in rewritesSchema:

respectOriginCacheControl: {
  description: 'When set to true (default), external rewrites will respect the Cache-Control header from the origin. When false, caching is disabled for this rewrite.',
  type: 'boolean',
}

This allows routes created from converted rewrites to properly validate with the schema when they contain the respectOriginCacheControl property.

Copy link
Copy Markdown
Contributor

@vercel vercel bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Suggestion:

Error messages use \\n (double backslash) instead of \n (single backslash) in template literals, causing literal \n characters to display instead of actual newlines.

View Details
📝 Patch Details
diff --git a/packages/next/src/index.ts b/packages/next/src/index.ts
index 06ef0d663..7eec9ee5a 100644
--- a/packages/next/src/index.ts
+++ b/packages/next/src/index.ts
@@ -596,11 +596,17 @@ export const build: BuildV2 = async buildOptions => {
       code: 'NEXT_OUTPUT_DIR_MISSING',
       message:
         `The Next.js output directory "${outputDirectory}" was not found at "${absoluteOutputDirectory}". ` +
-        `This is usually caused by one of the following:\n\n` +
+        `This is usually caused by one of the following:
+
+` +
         `1. The "Output Directory" setting in your project is misconfigured. ` +
-        `Check your project settings and ensure the output directory matches your Next.js configuration.\n\n` +
+        `Check your project settings and ensure the output directory matches your Next.js configuration.
+
+` +
         `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.\n\n` +
+        `Add "${outputDirectory}/**" to the "outputs" array in your turbo.json for the build task.
+
+` +
         `3. The build command did not complete successfully. Check the build logs above for errors.`,
       link: 'https://err.sh/vercel/vercel/now-next-routes-manifest',
     });
@@ -612,10 +618,16 @@ export const build: BuildV2 = async buildOptions => {
       code: 'NEXT_OUTPUT_DIR_EMPTY',
       message:
         `The Next.js output directory "${outputDirectory}" exists but is empty. ` +
-        `This is usually caused by one of the following:\n\n` +
+        `This is usually caused by one of the following:
+
+` +
         `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.\n\n` +
-        `2. The build command did not generate any output. Check the build logs above for errors.\n\n` +
+        `Add "${outputDirectory}/**" to the "outputs" array in your turbo.json for the build task.
+
+` +
+        `2. The build command did not generate any output. Check the build logs above for errors.
+
+` +
         `3. A previous build step may have cleared the output directory.`,
       link: 'https://err.sh/vercel/vercel/now-next-routes-manifest',
     });

Analysis

Issue Verification

The issue was confirmed to exist in packages/next/src/index.ts. The error messages for NEXT_OUTPUT_DIR_MISSING and NEXT_OUTPUT_DIR_EMPTY used double backslash sequences (\\n\\n) in template literals.

In JavaScript/TypeScript template literals:

  • \n produces an actual newline character (correct)
  • \\n produces a literal backslash followed by 'n' character (incorrect)

Affected Lines

  1. NEXT_OUTPUT_DIR_MISSING error (lines 599, 601, 603):

    • Line 599: This is usually caused by one of the following:\\n\\n
    • Line 601: Check your project settings...\\n\\n
    • Line 603: Add "${outputDirectory}/**"...\\n\\n
  2. NEXT_OUTPUT_DIR_EMPTY error (lines 615, 617, 618):

    • Line 615: This is usually caused by one of the following:\\n\\n
    • Line 617: Add "${outputDirectory}/**"...\\n\\n
    • Line 618: The build command did not generate...\\n\\n

Impact

When these errors were thrown, users would see error output like:

This is usually caused by one of the following:\n\n
1. The "Output Directory" setting...

Instead of the properly formatted:

This is usually caused by one of the following:

1. The "Output Directory" setting...

Fix Applied

All instances of \\n\\n have been replaced with \n\n across both error messages. The file now contains proper template literal newline sequences that will render as actual line breaks in error output.

Copy link
Copy Markdown
Contributor

@vercel vercel bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Suggestion:

Error messages use \\n (double backslash) instead of \n (single backslash) in template literals, causing literal \n characters to display instead of actual newlines.

View Details
📝 Patch Details
diff --git a/packages/next/src/index.ts b/packages/next/src/index.ts
index 06ef0d663..7eec9ee5a 100644
--- a/packages/next/src/index.ts
+++ b/packages/next/src/index.ts
@@ -596,11 +596,17 @@ export const build: BuildV2 = async buildOptions => {
       code: 'NEXT_OUTPUT_DIR_MISSING',
       message:
         `The Next.js output directory "${outputDirectory}" was not found at "${absoluteOutputDirectory}". ` +
-        `This is usually caused by one of the following:\n\n` +
+        `This is usually caused by one of the following:
+
+` +
         `1. The "Output Directory" setting in your project is misconfigured. ` +
-        `Check your project settings and ensure the output directory matches your Next.js configuration.\n\n` +
+        `Check your project settings and ensure the output directory matches your Next.js configuration.
+
+` +
         `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.\n\n` +
+        `Add "${outputDirectory}/**" to the "outputs" array in your turbo.json for the build task.
+
+` +
         `3. The build command did not complete successfully. Check the build logs above for errors.`,
       link: 'https://err.sh/vercel/vercel/now-next-routes-manifest',
     });
@@ -612,10 +618,16 @@ export const build: BuildV2 = async buildOptions => {
       code: 'NEXT_OUTPUT_DIR_EMPTY',
       message:
         `The Next.js output directory "${outputDirectory}" exists but is empty. ` +
-        `This is usually caused by one of the following:\n\n` +
+        `This is usually caused by one of the following:
+
+` +
         `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.\n\n` +
-        `2. The build command did not generate any output. Check the build logs above for errors.\n\n` +
+        `Add "${outputDirectory}/**" to the "outputs" array in your turbo.json for the build task.
+
+` +
+        `2. The build command did not generate any output. Check the build logs above for errors.
+
+` +
         `3. A previous build step may have cleared the output directory.`,
       link: 'https://err.sh/vercel/vercel/now-next-routes-manifest',
     });

Analysis

Issue Verification

The issue was confirmed to exist in packages/next/src/index.ts. The error messages for NEXT_OUTPUT_DIR_MISSING and NEXT_OUTPUT_DIR_EMPTY used double backslash sequences (\\n\\n) in template literals.

In JavaScript/TypeScript template literals:

  • \n produces an actual newline character (correct)
  • \\n produces a literal backslash followed by 'n' character (incorrect)

Affected Lines

  1. NEXT_OUTPUT_DIR_MISSING error (lines 599, 601, 603):

    • Line 599: This is usually caused by one of the following:\\n\\n
    • Line 601: Check your project settings...\\n\\n
    • Line 603: Add "${outputDirectory}/**"...\\n\\n
  2. NEXT_OUTPUT_DIR_EMPTY error (lines 615, 617, 618):

    • Line 615: This is usually caused by one of the following:\\n\\n
    • Line 617: Add "${outputDirectory}/**"...\\n\\n
    • Line 618: The build command did not generate...\\n\\n

Impact

When these errors were thrown, users would see error output like:

This is usually caused by one of the following:\n\n
1. The "Output Directory" setting...

Instead of the properly formatted:

This is usually caused by one of the following:

1. The "Output Directory" setting...

Fix Applied

All instances of \\n\\n have been replaced with \n\n across both error messages. The file now contains proper template literal newline sequences that will render as actual line breaks in error output.

Copy link
Copy Markdown
Contributor

@vercel vercel bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Suggestion:

Error messages use \\n (double backslash) instead of \n (single backslash) in template literals, causing literal \n characters to display instead of actual newlines.

View Details
📝 Patch Details
diff --git a/packages/next/src/index.ts b/packages/next/src/index.ts
index 06ef0d663..7eec9ee5a 100644
--- a/packages/next/src/index.ts
+++ b/packages/next/src/index.ts
@@ -596,11 +596,17 @@ export const build: BuildV2 = async buildOptions => {
       code: 'NEXT_OUTPUT_DIR_MISSING',
       message:
         `The Next.js output directory "${outputDirectory}" was not found at "${absoluteOutputDirectory}". ` +
-        `This is usually caused by one of the following:\n\n` +
+        `This is usually caused by one of the following:
+
+` +
         `1. The "Output Directory" setting in your project is misconfigured. ` +
-        `Check your project settings and ensure the output directory matches your Next.js configuration.\n\n` +
+        `Check your project settings and ensure the output directory matches your Next.js configuration.
+
+` +
         `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.\n\n` +
+        `Add "${outputDirectory}/**" to the "outputs" array in your turbo.json for the build task.
+
+` +
         `3. The build command did not complete successfully. Check the build logs above for errors.`,
       link: 'https://err.sh/vercel/vercel/now-next-routes-manifest',
     });
@@ -612,10 +618,16 @@ export const build: BuildV2 = async buildOptions => {
       code: 'NEXT_OUTPUT_DIR_EMPTY',
       message:
         `The Next.js output directory "${outputDirectory}" exists but is empty. ` +
-        `This is usually caused by one of the following:\n\n` +
+        `This is usually caused by one of the following:
+
+` +
         `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.\n\n` +
-        `2. The build command did not generate any output. Check the build logs above for errors.\n\n` +
+        `Add "${outputDirectory}/**" to the "outputs" array in your turbo.json for the build task.
+
+` +
+        `2. The build command did not generate any output. Check the build logs above for errors.
+
+` +
         `3. A previous build step may have cleared the output directory.`,
       link: 'https://err.sh/vercel/vercel/now-next-routes-manifest',
     });

Analysis

Issue Verification

The issue was confirmed to exist in packages/next/src/index.ts. The error messages for NEXT_OUTPUT_DIR_MISSING and NEXT_OUTPUT_DIR_EMPTY used double backslash sequences (\\n\\n) in template literals.

In JavaScript/TypeScript template literals:

  • \n produces an actual newline character (correct)
  • \\n produces a literal backslash followed by 'n' character (incorrect)

Affected Lines

  1. NEXT_OUTPUT_DIR_MISSING error (lines 599, 601, 603):

    • Line 599: This is usually caused by one of the following:\\n\\n
    • Line 601: Check your project settings...\\n\\n
    • Line 603: Add "${outputDirectory}/**"...\\n\\n
  2. NEXT_OUTPUT_DIR_EMPTY error (lines 615, 617, 618):

    • Line 615: This is usually caused by one of the following:\\n\\n
    • Line 617: Add "${outputDirectory}/**"...\\n\\n
    • Line 618: The build command did not generate...\\n\\n

Impact

When these errors were thrown, users would see error output like:

This is usually caused by one of the following:\n\n
1. The "Output Directory" setting...

Instead of the properly formatted:

This is usually caused by one of the following:

1. The "Output Directory" setting...

Fix Applied

All instances of \\n\\n have been replaced with \n\n across both error messages. The file now contains proper template literal newline sequences that will render as actual line breaks in error output.

Copy link
Copy Markdown
Contributor

@vercel vercel bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Suggestion:

Error messages use \\n (double backslash) instead of \n (single backslash) in template literals, causing literal \n characters to display instead of actual newlines.

View Details
📝 Patch Details
diff --git a/packages/next/src/index.ts b/packages/next/src/index.ts
index 06ef0d663..7eec9ee5a 100644
--- a/packages/next/src/index.ts
+++ b/packages/next/src/index.ts
@@ -596,11 +596,17 @@ export const build: BuildV2 = async buildOptions => {
       code: 'NEXT_OUTPUT_DIR_MISSING',
       message:
         `The Next.js output directory "${outputDirectory}" was not found at "${absoluteOutputDirectory}". ` +
-        `This is usually caused by one of the following:\n\n` +
+        `This is usually caused by one of the following:
+
+` +
         `1. The "Output Directory" setting in your project is misconfigured. ` +
-        `Check your project settings and ensure the output directory matches your Next.js configuration.\n\n` +
+        `Check your project settings and ensure the output directory matches your Next.js configuration.
+
+` +
         `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.\n\n` +
+        `Add "${outputDirectory}/**" to the "outputs" array in your turbo.json for the build task.
+
+` +
         `3. The build command did not complete successfully. Check the build logs above for errors.`,
       link: 'https://err.sh/vercel/vercel/now-next-routes-manifest',
     });
@@ -612,10 +618,16 @@ export const build: BuildV2 = async buildOptions => {
       code: 'NEXT_OUTPUT_DIR_EMPTY',
       message:
         `The Next.js output directory "${outputDirectory}" exists but is empty. ` +
-        `This is usually caused by one of the following:\n\n` +
+        `This is usually caused by one of the following:
+
+` +
         `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.\n\n` +
-        `2. The build command did not generate any output. Check the build logs above for errors.\n\n` +
+        `Add "${outputDirectory}/**" to the "outputs" array in your turbo.json for the build task.
+
+` +
+        `2. The build command did not generate any output. Check the build logs above for errors.
+
+` +
         `3. A previous build step may have cleared the output directory.`,
       link: 'https://err.sh/vercel/vercel/now-next-routes-manifest',
     });

Analysis

Issue Verification

The issue was confirmed to exist in packages/next/src/index.ts. The error messages for NEXT_OUTPUT_DIR_MISSING and NEXT_OUTPUT_DIR_EMPTY used double backslash sequences (\\n\\n) in template literals.

In JavaScript/TypeScript template literals:

  • \n produces an actual newline character (correct)
  • \\n produces a literal backslash followed by 'n' character (incorrect)

Affected Lines

  1. NEXT_OUTPUT_DIR_MISSING error (lines 599, 601, 603):

    • Line 599: This is usually caused by one of the following:\\n\\n
    • Line 601: Check your project settings...\\n\\n
    • Line 603: Add "${outputDirectory}/**"...\\n\\n
  2. NEXT_OUTPUT_DIR_EMPTY error (lines 615, 617, 618):

    • Line 615: This is usually caused by one of the following:\\n\\n
    • Line 617: Add "${outputDirectory}/**"...\\n\\n
    • Line 618: The build command did not generate...\\n\\n

Impact

When these errors were thrown, users would see error output like:

This is usually caused by one of the following:\n\n
1. The "Output Directory" setting...

Instead of the properly formatted:

This is usually caused by one of the following:

1. The "Output Directory" setting...

Fix Applied

All instances of \\n\\n have been replaced with \n\n across both error messages. The file now contains proper template literal newline sequences that will render as actual line breaks in error output.

Copy link
Copy Markdown
Contributor

@vercel vercel bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Suggestion:

Error messages use \\n (double backslash) instead of \n (single backslash) in template literals, causing literal \n characters to display instead of actual newlines.

View Details
📝 Patch Details
diff --git a/packages/next/src/index.ts b/packages/next/src/index.ts
index 06ef0d663..7eec9ee5a 100644
--- a/packages/next/src/index.ts
+++ b/packages/next/src/index.ts
@@ -596,11 +596,17 @@ export const build: BuildV2 = async buildOptions => {
       code: 'NEXT_OUTPUT_DIR_MISSING',
       message:
         `The Next.js output directory "${outputDirectory}" was not found at "${absoluteOutputDirectory}". ` +
-        `This is usually caused by one of the following:\n\n` +
+        `This is usually caused by one of the following:
+
+` +
         `1. The "Output Directory" setting in your project is misconfigured. ` +
-        `Check your project settings and ensure the output directory matches your Next.js configuration.\n\n` +
+        `Check your project settings and ensure the output directory matches your Next.js configuration.
+
+` +
         `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.\n\n` +
+        `Add "${outputDirectory}/**" to the "outputs" array in your turbo.json for the build task.
+
+` +
         `3. The build command did not complete successfully. Check the build logs above for errors.`,
       link: 'https://err.sh/vercel/vercel/now-next-routes-manifest',
     });
@@ -612,10 +618,16 @@ export const build: BuildV2 = async buildOptions => {
       code: 'NEXT_OUTPUT_DIR_EMPTY',
       message:
         `The Next.js output directory "${outputDirectory}" exists but is empty. ` +
-        `This is usually caused by one of the following:\n\n` +
+        `This is usually caused by one of the following:
+
+` +
         `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.\n\n` +
-        `2. The build command did not generate any output. Check the build logs above for errors.\n\n` +
+        `Add "${outputDirectory}/**" to the "outputs" array in your turbo.json for the build task.
+
+` +
+        `2. The build command did not generate any output. Check the build logs above for errors.
+
+` +
         `3. A previous build step may have cleared the output directory.`,
       link: 'https://err.sh/vercel/vercel/now-next-routes-manifest',
     });

Analysis

Issue Verification

The issue was confirmed to exist in packages/next/src/index.ts. The error messages for NEXT_OUTPUT_DIR_MISSING and NEXT_OUTPUT_DIR_EMPTY used double backslash sequences (\\n\\n) in template literals.

In JavaScript/TypeScript template literals:

  • \n produces an actual newline character (correct)
  • \\n produces a literal backslash followed by 'n' character (incorrect)

Affected Lines

  1. NEXT_OUTPUT_DIR_MISSING error (lines 599, 601, 603):

    • Line 599: This is usually caused by one of the following:\\n\\n
    • Line 601: Check your project settings...\\n\\n
    • Line 603: Add "${outputDirectory}/**"...\\n\\n
  2. NEXT_OUTPUT_DIR_EMPTY error (lines 615, 617, 618):

    • Line 615: This is usually caused by one of the following:\\n\\n
    • Line 617: Add "${outputDirectory}/**"...\\n\\n
    • Line 618: The build command did not generate...\\n\\n

Impact

When these errors were thrown, users would see error output like:

This is usually caused by one of the following:\n\n
1. The "Output Directory" setting...

Instead of the properly formatted:

This is usually caused by one of the following:

1. The "Output Directory" setting...

Fix Applied

All instances of \\n\\n have been replaced with \n\n across both error messages. The file now contains proper template literal newline sequences that will render as actual line breaks in error output.

Copy link
Copy Markdown
Contributor

@vercel vercel bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Suggestion:

Error messages use \\n (double backslash) instead of \n (single backslash) in template literals, causing literal \n characters to display instead of actual newlines.

View Details
📝 Patch Details
diff --git a/packages/next/src/index.ts b/packages/next/src/index.ts
index 06ef0d663..7eec9ee5a 100644
--- a/packages/next/src/index.ts
+++ b/packages/next/src/index.ts
@@ -596,11 +596,17 @@ export const build: BuildV2 = async buildOptions => {
       code: 'NEXT_OUTPUT_DIR_MISSING',
       message:
         `The Next.js output directory "${outputDirectory}" was not found at "${absoluteOutputDirectory}". ` +
-        `This is usually caused by one of the following:\n\n` +
+        `This is usually caused by one of the following:
+
+` +
         `1. The "Output Directory" setting in your project is misconfigured. ` +
-        `Check your project settings and ensure the output directory matches your Next.js configuration.\n\n` +
+        `Check your project settings and ensure the output directory matches your Next.js configuration.
+
+` +
         `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.\n\n` +
+        `Add "${outputDirectory}/**" to the "outputs" array in your turbo.json for the build task.
+
+` +
         `3. The build command did not complete successfully. Check the build logs above for errors.`,
       link: 'https://err.sh/vercel/vercel/now-next-routes-manifest',
     });
@@ -612,10 +618,16 @@ export const build: BuildV2 = async buildOptions => {
       code: 'NEXT_OUTPUT_DIR_EMPTY',
       message:
         `The Next.js output directory "${outputDirectory}" exists but is empty. ` +
-        `This is usually caused by one of the following:\n\n` +
+        `This is usually caused by one of the following:
+
+` +
         `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.\n\n` +
-        `2. The build command did not generate any output. Check the build logs above for errors.\n\n` +
+        `Add "${outputDirectory}/**" to the "outputs" array in your turbo.json for the build task.
+
+` +
+        `2. The build command did not generate any output. Check the build logs above for errors.
+
+` +
         `3. A previous build step may have cleared the output directory.`,
       link: 'https://err.sh/vercel/vercel/now-next-routes-manifest',
     });

Analysis

Issue Verification

The issue was confirmed to exist in packages/next/src/index.ts. The error messages for NEXT_OUTPUT_DIR_MISSING and NEXT_OUTPUT_DIR_EMPTY used double backslash sequences (\\n\\n) in template literals.

In JavaScript/TypeScript template literals:

  • \n produces an actual newline character (correct)
  • \\n produces a literal backslash followed by 'n' character (incorrect)

Affected Lines

  1. NEXT_OUTPUT_DIR_MISSING error (lines 599, 601, 603):

    • Line 599: This is usually caused by one of the following:\\n\\n
    • Line 601: Check your project settings...\\n\\n
    • Line 603: Add "${outputDirectory}/**"...\\n\\n
  2. NEXT_OUTPUT_DIR_EMPTY error (lines 615, 617, 618):

    • Line 615: This is usually caused by one of the following:\\n\\n
    • Line 617: Add "${outputDirectory}/**"...\\n\\n
    • Line 618: The build command did not generate...\\n\\n

Impact

When these errors were thrown, users would see error output like:

This is usually caused by one of the following:\n\n
1. The "Output Directory" setting...

Instead of the properly formatted:

This is usually caused by one of the following:

1. The "Output Directory" setting...

Fix Applied

All instances of \\n\\n have been replaced with \n\n across both error messages. The file now contains proper template literal newline sequences that will render as actual line breaks in error output.

@tknickman tknickman merged commit 8356799 into main Jan 12, 2026
12 checks passed
@tknickman tknickman deleted the changeset-release/main branch January 12, 2026 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants