Platform
Vercel fixes
Choose a Vercel error, check its source, and follow the relevant walkthrough.
Build-time vs runtime errors on Vercel
First, identify the deployment you are actually testing. Copy its URL into your notes alongside the commit and the failing route. Decide whether you need to investigate a build that never completed or a request to an already deployed app. Use the two log views below as separate starting points. For a hosting decision, see Vercel vs Netlify; avoid switching hosts before collecting the original failure.
When deployment itself fails
Vercel's build logs contain build-tool versions, dependency and compilation output, warnings and errors, and are accessible from the production deployment tile. Vercel build logs. Open the failed attempt and read around the first meaningful error. Note the command, package name and file path involved. Compare the project's install command and build command with the ones you run locally. Avoid editing routing rules to address a dependency installation error; choose a change that directly addresses the failing stage.
When a deployed request fails
Vercel exposes runtime logs through the project's Logs view, including function invocations and request-grouped log entries. Vercel runtime logs. Reproduce the failure once and note the time. Narrow the view to that deployment and route, then inspect the exception and surrounding messages. Use the first stack frame in your own code as a starting point for inspection. Check the inputs reaching that handler before asking a code assistant to rewrite the whole application.
When to inspect limits
Vercel documents function limits for execution duration, bundle size, memory and request or response payload size. Vercel function limits. Read the limit that matches the error rather than increasing every setting. For an upload, compare a small file with the failing one. For a slow handler, measure each external call separately. For a deployment package problem, inspect dependencies included in the function. Keep those experiments small enough that you can identify exactly which change affected the result.
Five Vercel errors to check first
Use these as diagnostic starting points, not a ranking of how often apps fail. Match the exact code in the response before opening a walkthrough. Record the original error before you redeploy, so you can tell whether a new failure replaced it.
- NOT_FOUND: Vercel uses this when the requested resource cannot be found. Official cause. Compare opening the root URL, navigating to a nested page, and refreshing that page directly. Then use the 404-on-refresh walkthrough if that is the behavior you observed.
- FUNCTION_INVOCATION_FAILED: A crashed runtime or uncaught exception can cause this function failure. Official cause. Inspect the failing request's stack trace before selecting an environment, runtime or database change. Follow the 500 investigation and keep your test request reproducible.
- FUNCTION_INVOCATION_TIMEOUT: The invocation exceeded its allowed execution time. Official cause. Time your network and database operations, then compare the result with the configured duration. Start with the function-timeout checklist rather than guessing which remote service is slow.
- FUNCTION_PAYLOAD_TOO_LARGE: The payload sent to the function exceeded the allowed size. Official cause. Inspect the request body and test a smaller input before changing application logic. Vercel's function limits page puts the request and response body limit at 4.5 MB, so check your request size against that first.
- DEPLOYMENT_NOT_FOUND: The request names a deployment that does not exist, potentially because the URL is wrong or the deployment was deleted. Official cause. Copy the URL from the deployment dashboard, compare it with the failing link, check that the deployment still exists and hasn't been deleted, and confirm you have permission to access it.
Before changing production again
Write a short test note with the route, action, expected result and observed response. Include the deployment identifier and a redacted excerpt of the relevant error. Apply one repair, rerun that exact test, and check an adjacent route that previously worked. If you cannot reproduce the problem, retain the log reference and collect another occurrence before making a broad change. Keep a known working deployment available while you compare results; treat restoring service and explaining the underlying cause as two separate tasks in your notes.
A worksheet for the failing Vercel request
Use a fresh note for one failed request. Fill in the deployment URL, request path, HTTP method, time, status and exact error code. Add the commit you meant to test. Leave credentials, cookies and personal data out of the note. For every suspected cause, write the observation that would support it and the test that would rule it out. Work through the cases below only when they match your evidence.
Example investigation: a form returns 500
Treat this as an illustrative exercise, not a diagnosis of your app. Submit the form once using harmless test data, find that request in the runtime view, and inspect the earliest application exception. If the trace names configuration, check the expected variable name in that deployment's settings without printing its value. If it names a database operation, inspect that operation's error separately. If the trace points at your form handler, examine the submitted fields and validation around that line. Keep the status code and stack trace together so you do not substitute an unrelated error from another request.
Example investigation: an upload fails
Prepare two non-sensitive test files with clearly different sizes. Send them through the same control and record the response for each. Inspect the network request to identify the endpoint receiving the file. When the response names FUNCTION_PAYLOAD_TOO_LARGE, reduce the request body before you change any timeout setting. When it names an invocation timeout, inspect elapsed time instead. After your repair, repeat both inputs and check the visible error message for a rejected file. Include a canceled upload in your manual checks, and avoid using customer documents as debugging samples.
Example investigation: only a deep link fails
Compare three actions on the same deployment: opening the home page, following an internal link, and pasting that destination into a new tab. Keep the route spelling and trailing slash consistent while comparing results. Inspect the generated route or output file that should serve the destination. Before adding a rewrite, identify which framework owns that path and whether you intend a page, an API handler or a static asset. Retest each kind after the change; do not declare a routing repair complete based only on the home page loading.
Ask for a bounded repair
Give your code assistant the redacted error, relevant handler or configuration file, and a precise acceptance test. Ask it to explain the connection between the proposed edit and the observed failure. Review changes to unrelated files before accepting them. Keep the original test note attached to the resulting commit or deployment. If the result remains uncertain, restore the known working version where appropriate and continue investigating on a separate deployment, using the same request details as your comparison point.
Last edited
92 fixes: 15 in full, then 77 more by title.
Top Vercel fixes
- 500: INTERNAL_SERVER_ERROR / FUNCTION_INVOCATION_FAILED on Vercel
Use a small test case to compare the behavior before and after your repair.
- Vercel custom domain shows "Invalid Configuration"
Follow the linked investigation with your own logs open; choose the step that matches the evidence.
- Clerk sign-in keeps redirecting in a loop
Review the proposed configuration change, deploy it deliberately, and check the affected route again.
More Vercel fixes
Older or narrower fixes for Vercel. Titles only.
- Vercel Deployment Protection returns 401 and blocks a webhook
- Next.js DynamicServerError during the Vercel build
- Vercel INFINITE_LOOP_DETECTED
- Vercel MIDDLEWARE_INVOCATION_TIMEOUT
- Vercel 404 DEPLOYMENT_NOT_FOUND
- Prisma on Vercel: query engine not found
- Base44 code export or moving to Vercel
- Vercel won't deploy a commit because it can't verify the commit author
- Vercel build error: No Output Directory found (missing public directory)
- 502 Bad Gateway / NO_RESPONSE_FROM_FUNCTION on Vercel
- Changed an environment variable on Vercel but the live site still uses the old value
- Vercel 413 FUNCTION_PAYLOAD_TOO_LARGE
- Vercel: Lost Git repository access, pushes no longer deploy
- Module not found: Can't resolve (build works locally, fails on Vercel)
- Stripe webhook failing: 404, 307/308 redirect, timeout or 500
- Stripe paid, but the user was not upgraded
- Clerk: auth() was called but clerkMiddleware() was not detected
- Clerk production deploy is still using pk_test_ keys
- Prisma: prepared statement "s0" already exists
- Anthropic API 402 billing_error or spend limit reached
- Clerk: Missing or invalid Publishable Key
- Prisma P1001: Can't reach database server
- Prisma P1000: Authentication failed against database server at {database_host}, the provided database credentials for {database_user} are not valid
- Prisma P2024: Timed out fetching a new connection from the connection pool
- MIDDLEWARE_INVOCATION_FAILED
- Firebase auth/operation-not-allowed
- Firebase auth/invalid-credential
- Prisma P2002: Unique constraint failed on the {constraint}
- Prisma P2021: The table {table} does not exist in the current database
- Prisma P2025: An operation failed because it depends on one or more records that were required but not found
- Lovable app is a blank white or black screen after publish
- too many connections / remaining connection slots are reserved (Supabase + serverless)
- next/image Un-configured Host
- Invalid "use server" Value
- Failed to find Server Action
- Claude API 401 authentication_error
- Claude API 400: This model does not support assistant message prefill
- Claude API 400: thinking.type.enabled is not supported for this model
- OpenAI API 503: Model temporarily overloaded (server_is_overloaded)
- Cloudflare invalid SSL certificate (Error 526) on a custom domain
- Lovable export code won't run locally or on another host
- ReferenceError: window is not defined
- Vite env var is undefined because the name has no VITE_ prefix
- Firebase signInWithRedirect fails on the deployed domain
- Supabase refresh_token_already_used: Refresh token has been revoked and falls outside the refresh token reuse interval
- Next.js Prerender Error during next build
- Next.js: NextRouter was not mounted
- Next.js: the middleware file convention is deprecated, use proxy
- Next.js: Missing Root Layout tags (html and body)
- Next.js: Using Node.js modules in Edge Runtime (Proxy or Middleware)
- Vibe-coded site not indexed by Google: how to fix it
- Event handlers cannot be passed to Client Component props
- Serverless Function has exceeded the unzipped maximum size of 250 MB
- OpenAI API 429: You exceeded your current quota / rate limit reached
- Invalid JWT after switching to sb_publishable or sb_secret keys
- Build failed: npm ERR! ERESOLVE
- Supabase error: JWT expired
- TypeError: Failed to fetch (only in production)
- Stripe secret key (sk_live_, sk_test_, or rk_) is in the front-end code
- AWS access key (AKIA) is in the front-end code
- Next.js: a client hook was used in a Server Component
- Next.js: useSearchParams() is missing a Suspense boundary
- Next.js: params, searchParams, or cookies() must be awaited
- Firebase auth/unauthorized-domain after deploy
- Stripe secret_key_required: a publishable key called a secret API
- Stripe customer portal session will not open
- Stripe api_key_expired: The API key provided has expired
- Next.js Security Update for Upstream Vulnerabilities
- My app won't come back after a restart: is it me or the platform?
- Next.js: a Client Component cannot be async
- Stripe parameter_unknown: the request has unexpected parameters
- OpenAI API 401: Incorrect API key provided
- Content Security Policy (CSP) header not set, or missing CSP directives
- X-Frame-Options header not set
- X-Content-Type-Options header missing
- CORS: Content-Type application/json is not safelisted and triggers a preflight
- Blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present