{"record":{"id":"ead6c94cc195287a","repo":"vercel/next.js","slug":"failed-to-deploy-project-linkres-stdout-linkr","errorCode":null,"errorMessage":"Failed to deploy project ${linkRes.stdout} ${linkRes.stderr} (${linkRes.exitCode})","messagePattern":"Failed to deploy project (.+?) (.+?) \\((.+?)\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"bench/vercel/project-utils.js","lineNumber":173,"sourceCode":"        'NEXT_TELEMETRY_DISABLED=1',\n        ...(VERCEL_EDGE_FUNCTIONS_BRIDGE_PKG\n          ? [\n              '--build-env',\n              `VERCEL_EDGE_FUNCTIONS_BRIDGE_PKG=${VERCEL_EDGE_FUNCTIONS_BRIDGE_PKG}`,\n            ]\n          : []),\n        '--force',\n        ...vercelFlags,\n        ...(forceCrash ? ['--env', 'CRASH_FUNCTION=1'] : []),\n      ],\n      {\n        cwd: appFolder,\n        env: vercelEnv,\n      }\n    )\n\n    if (deployRes.exitCode !== 0) {\n      throw new Error(\n        `Failed to deploy project ${linkRes.stdout} ${linkRes.stderr} (${linkRes.exitCode})`\n      )\n    }\n\n    return deployRes.stdout\n  } catch (err) {\n    console.log(red('Deployment failed: ', err))\n    throw err\n  }\n}\n","sourceCodeStart":155,"sourceCodeEnd":184,"githubUrl":"https://github.com/vercel/next.js/blob/0ae8c72462952df163f1b1e0726641bc5b40dc93/bench/vercel/project-utils.js#L155-L184","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Read the stderr (note it shows linkRes fields due to a source bug, so also check the deploy output captured upstream).","Reproduce the build locally with the same build-env flags to see the real error.","If forceCrash was enabled, disable it.","Check Vercel deployment logs in the dashboard for the remote build error.","Verify VERCEL_EDGE_FUNCTIONS_BRIDGE_PKG (if set) points to a published, installable package."],"exampleFix":"# before: remote build fails on missing package\nVERCEL_EDGE_FUNCTIONS_BRIDGE_PKG=next@nonexistent\n\n# after: point to a valid package or unset it\n# (unset) pnpm test:vercel","handlingStrategy":"try-catch","validationCode":"// Reproduce the exact remote build locally with the same build-env flags\nawait execa('vercel', ['build', '--build-env', 'NEXT_PRIVATE_TEST_MODE=1'], { cwd: appFolder })","typeGuard":"null","tryCatchPattern":"try {\n  return await deployProject(name, folder)\n} catch (e) {\n  // Note: the message surfaces linkRes fields (source bug) — check deploy logs too\n  console.error('Deploy failed — see Vercel dashboard build logs:', (e as Error).message)\n  throw e\n}","preventionTips":["Run `vercel build` locally with the same build-env flags before deploying.","Keep VERCEL_EDGE_FUNCTIONS_BRIDGE_PKG pointing at a published package or unset it.","Disable forceCrash mode unless intentionally testing failure.","Watch Vercel deployment logs for the real remote build error."],"tags":["vercel","deployment","build","cli"],"analyzedSha":"0ae8c72462952df163f1b1e0726641bc5b40dc93","analyzedAt":"2026-08-06T19:44:29.143Z","schemaVersion":2},"datasetVersion":"2026-08-07T02:17:10.218Z"}