Hi everyone,
I’m experiencing a persistent deployment failure on Vercel that I cannot resolve. My Next.js 16 project builds successfully - compilation passes, TypeScript checks pass, and static pages are generated - but the deployment fails every time with this error:
“An unexpected error occurred when running this build. This may be a transient issue, please try rebuilding your project.”
The build works perfectly on my local machine, so this appears to be an infrastructure issue on Vercel’s side.
I’ve tried multiple troubleshooting steps without success:
- Downgraded from Next.js 16 to 15 - same error
- Changed Node.js version from 22.x to 20.x - same error
- Added VERCEL_PRERENDER_METADATA_BOUNDARY=1 environment variable - same error
- Switched from Turbopack to Webpack - same error
- Added output: ‘standalone’ to next.config.js - same error
- Cleared build cache and redeployed multiple times - same error
I’ve had multiple consecutive failed deployments with the sameunexpected_errorcode. Any help would be greatly appreciated!
Current: My Next.js 16 project builds successfully (compilation passes, TypeScript checks pass, static pages generate) but the deployment fails with the error: “An unexpected error occurred when running this build. This may be a transient issue, please try rebuilding your project.”
Expected: The deployment should complete successfully after a successful build.
The build works perfectly on my local machine with npm run build. This issue occurs only on Vercel’s infrastructure.
next.config.js:
/** @type {import(‘next’).NextConfig} */
const nextConfig = {
images: {
unoptimized: true,
},
output: ‘standalone’,
};
module.exports = nextConfig;
Steps to reproduce:
- Push any commit to the main branch
- Vercel starts the build process
- Build compiles successfully (all routes listed, no errors)
- Deployment fails with “unexpected error”
What I’ve tried:
-
Switched from Next.js 15 to 16 - same error
-
Changed Node.js from 22.x to 20.x - same error
-
Added VERCEL_PRERENDER_METADATA_BOUNDARY=1 env variable - same error
-
Switched from Turbopack to Webpack (–webpack flag) - same error
-
Added output: ‘standalone’ - same error
-
Cleared build cache - same error
-
Repository: github.com/DNO8/ScorchCoreWeb
- Branch: main
- Framework: Next.js 16.2.6
- Node.js: 20.x (also tried 22.x)
- Build region: Washington, D.C. (iad1)
- Plan: Hobby
- All routes are dynamic (server-rendered on demand)
- Local build works without issues