The build fails on Vercel
next build type-checks your TypeScript and stops on errors that the preview tolerated. Open the failed deployment in Vercel and read the build log. The useful error sits above the final "exited with 1" line. Run the same build on your machine and fix it at the source. Turning type checks off hides the problem until it shows up in front of a user.
npm install
npx next build
Features work in v0 but fail once deployed
Environment variables are set per environment: Development, Preview and Production. The v0 preview reads Development values, so a key you only added there works in the preview and fails once published. Add every variable the app reads for Production too, then publish again. Changing a variable does not update deployments that already exist.
Not sure which of these it is? We'll tell you in 24 hours, free.
Get a free health checkA secret key is visible in the browser
In Next.js, any variable that starts with NEXT_PUBLIC_ is bundled into browser code. API keys for OpenAI, Stripe secret keys and database passwords must not have that prefix. Call those services from a Route Handler or Server Action so the key never leaves the server, then rotate any key that was exposed.
Images from another site don't load
The Next.js Image component only optimizes remote images from hosts you allow. Add the host to images.remotePatterns in next.config.
// next.config.ts
export default {
images: {
remotePatterns: [{ protocol: "https", hostname: "images.example.com" }],
},
};
The data isn't real yet
Generated apps often start with sample arrays in the code so the screens look finished. Before launch, list every screen that reads data and confirm it reads from a real database, checks who is signed in, and handles empty and error states.
Questions people ask
Why does my v0 app build fail on Vercel when the preview worked?
The production build runs a full TypeScript check and compiles every route. Errors the preview ignored will stop it. Run npx next build locally to see the same error and fix it.
Is it safe to use NEXT_PUBLIC_ for my API key?
Only for keys that are meant to be public, such as a publishable key. Secret keys must stay in server-only variables without the NEXT_PUBLIC_ prefix.