vercel/next.js · error

Failed to deploy project ${linkRes.stdout} ${linkRes.stderr}

Error message

Failed to deploy project ${linkRes.stdout} ${linkRes.stderr} (${linkRes.exitCode})

What it means

Thrown by deployProject when `vercel deploy --force` exits non-zero after a successful link. This is the actual upload+build step on Vercel's infrastructure. Note: the message reports linkRes fields (a copy-paste artifact in the source) rather than deployRes, but the trigger is the deploy command failing. The included stdout/stderr/exitCode help diagnose the remote build failure.

Source

Thrown at bench/vercel/project-utils.js:173

        'NEXT_TELEMETRY_DISABLED=1',
        ...(VERCEL_EDGE_FUNCTIONS_BRIDGE_PKG
          ? [
              '--build-env',
              `VERCEL_EDGE_FUNCTIONS_BRIDGE_PKG=${VERCEL_EDGE_FUNCTIONS_BRIDGE_PKG}`,
            ]
          : []),
        '--force',
        ...vercelFlags,
        ...(forceCrash ? ['--env', 'CRASH_FUNCTION=1'] : []),
      ],
      {
        cwd: appFolder,
        env: vercelEnv,
      }
    )

    if (deployRes.exitCode !== 0) {
      throw new Error(
        `Failed to deploy project ${linkRes.stdout} ${linkRes.stderr} (${linkRes.exitCode})`
      )
    }

    return deployRes.stdout
  } catch (err) {
    console.log(red('Deployment failed: ', err))
    throw err
  }
}

View on GitHub (pinned to 0ae8c72462)

Solutions

  1. Read the stderr (note it shows linkRes fields due to a source bug, so also check the deploy output captured upstream).
  2. Reproduce the build locally with the same build-env flags to see the real error.
  3. If forceCrash was enabled, disable it.
  4. Check Vercel deployment logs in the dashboard for the remote build error.
  5. Verify VERCEL_EDGE_FUNCTIONS_BRIDGE_PKG (if set) points to a published, installable package.

Example fix

# before: remote build fails on missing package
VERCEL_EDGE_FUNCTIONS_BRIDGE_PKG=next@nonexistent

# after: point to a valid package or unset it
# (unset) pnpm test:vercel
Defensive patterns

Strategy: try-catch

Validate before calling

// Reproduce the exact remote build locally with the same build-env flags
await execa('vercel', ['build', '--build-env', 'NEXT_PRIVATE_TEST_MODE=1'], { cwd: appFolder })

Type guard

null

Try / catch

try {
  return await deployProject(name, folder)
} catch (e) {
  // Note: the message surfaces linkRes fields (source bug) — check deploy logs too
  console.error('Deploy failed — see Vercel dashboard build logs:', (e as Error).message)
  throw e
}

Prevention

When it happens

Trigger: Remote build failure (compile error, missing env, OOM, build timeout); the deployment exceeded plan limits; the build-env flags are invalid; VERCEL_EDGE_FUNCTIONS_BRIDGE_PKG resolves to a missing package; forceCrash mode (--env CRASH_FUNCTION=1) intentionally breaks the build; network interruption during upload.

Common situations: A code change introduces a build error only caught on Vercel's build environment; edge function bridge package version mismatch; deployment quota hit; the fixture app references an unpublished local Next.js build.

Related errors


AI-assisted analysis of vercel/next.js@0ae8c72462 (2026-08-06). Data as JSON: /api/errors/ead6c94cc195287a. Report an issue: GitHub.