Hey everyone
Trying to deploy a Turborepo project to Vercel and while build is generated successfully, I’m getting error Error: The BUILD_ID file was not found in the Output Directory. Did you forget to run "next build" in your Build Command?
in the end of the build step and of course it doesn’t deploy.
Locally tho, BUILD_ID is present inside .next
directory and I can successfully run npm run start
with Turborepo.
Below is my turbo.json
{
"$schema": "https://turbo.build/schema.json",
"globalEnv": [
"NODE_ENV",
"DATABASE_URL"
],
"ui": "tui",
"tasks": {
"build": {
"dependsOn": [
"^build"
],
"outputs": [
".next/**",
"!.next/cache/**"
],
"env": [
"NEXT_PUBLIC_SUPABASE_ANON_KEY",
"NEXT_PUBLIC_SUPABASE_URL",
"NEXT_PUBLIC_STRIPE_KEY",
"STRIPE_API_KEY",
"NEXT_PRUBLIC_CART_CANCEL_URL",
"NEXT_PUBLIC_CART_SUCCESS_URL",
"TEACHWORKS_API_KEY",
"UPSTASH_KAFKA_REST_PASSWORD",
"UPSTASH_KAFKA_REST_URL",
"UPSTASH_KAFKA_REST_USERNAME",
"KAFKA_BROKER",
"KAFKA_USERNAME",
"KAFKA_PASSWORD",
"MONGODB_URI",
"RESEND_API_KEY",
"SENTRY_AUTH_TOKEN",
"CLERK_SECRET_KEY",
"NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY",
"NEXTAUTH_SECRET",
"WEBHOOK_SECRET",
"NEXT_PUBLIC_BASE_URL",
"DIRECT_URL"
]
},
"db:generate": {
"cache": false
},
"db:migrate": {
"cache": false
},
"db:push": {
"cache": false
},
"ios": {
"cache": false
},
"check-types": {
"dependsOn": [
"^check-types"
]
},
"dev": {
"persistent": true,
"dependsOn": [
"^db:generate"
],
"cache": false,
"inputs": [
".env"
]
}
}
}
I’m pretty new to Turborepo setup, but this is the first time I see error like this with Vercel