Next.js · App Router · Vercel
Next.js Production Checklist
Local looks fine. Preview looks fine. Production still ships with noindex, missing headers, or OG images on the wrong host. Scan the live URL, then paste the AI prompt into your editor.
Copy-paste Next.js fixes
These cover the failures we see most on App Router + Vercel launches.
app/robots.ts still blocking everything
// app/robots.ts
export default function robots() {
return {
rules: { userAgent: '*', allow: '/' },
sitemap: 'https://yourdomain.com/sitemap.xml',
}
}metadata.robots left on noindex from staging
// app/layout.tsx
export const metadata = {
robots: { index: true, follow: true }, // or omit — default is indexable
}Security headers via next.config
// next.config.js
module.exports = {
async headers() {
return [{
source: '/(.*)',
headers: [
{ key: 'Strict-Transport-Security', value: 'max-age=31536000; includeSubDomains' },
{ key: 'X-Content-Type-Options', value: 'nosniff' },
{ key: 'X-Frame-Options', value: 'DENY' },
{ key: 'Referrer-Policy', value: 'strict-origin-when-cross-origin' },
],
}]
},
}metadataBase so OG / canonical use production
// app/layout.tsx
export const metadata = {
metadataBase: new URL(process.env.NEXT_PUBLIC_SITE_URL!),
alternates: { canonical: '/' },
openGraph: { images: [{ url: '/og.png', width: 1200, height: 630 }] },
}Vercel go-live ticks
- □Attach the custom domain and wait for SSL to show Valid
- □Set NEXT_PUBLIC_SITE_URL to https://yourdomain.com (not *.vercel.app)
- □Promote the production deployment — don't share Preview URLs on launch posts
- □Optional: enable Vercel Analytics before you send traffic
Related
- robots.txt checker
- Security headers checker
- Website launch checklist — stack-agnostic launch accidents
- Methodology
- Go-Live Clearance home