Vercel said "Ready". Every route returned 500.
DEV Community

Vercel said "Ready". Every route returned 500.

Vercel said "Ready". My users got nothing.

Twelve seconds after I hit deploy, the dashboard showed "Deployed to Production" and "Ready". I turned off Deployment Protection, opened the URL - and every single route answered 500. Not one route. All of them. The root page. The health check. The API. FUNCTION_INVOCATION_FAILED, error rate 100%.

That is the worst kind of failure in software: the deploy is green and the service is dead. Nothing in the dashboard says "broken". Nothing is red. The production deployment says "Ready" while serving nothing at all.

And the cruelest part: everything had passed. 84 of 84 tests. The server answered 200 on every route from my own machine - including the legal and illegal example replays. The code was fine. The code was not the problem. The wiring between the code and the runtime was.

Diffing Against a Working Sibling

So I stopped re-reading my own code and did the one thing that actually finds this class of bug: I compared it with its working sibling. Wildcard 11 - same shape, same framework preset, same vercel.json, live and answering 200s.

I diffed the two server files, and the difference was at the very bottom. Wildcard 11 ends by creating the server, exporting it as the default export, and listening only when run directly - with a comment that Vercel's Node runtime requires the default export to be a function or a server.

Wildcard 12 ended differently: it exported a named buildServer function and never created a server instance at all. Locally that is fine - node server.js calls buildServer() and listens. On Vercel there was nothing to route through. The runtime tried to invoke a function that did not exist, on every request, and answered 500 for all of them.

The 8-Line Fix

The fix was 8 lines: create the server from buildServer(), export it as default, and listen on that same instance when run directly.

Tests: 84 of 84. Local checks: all 200s, legal replay legal, illegal replay illegal. Push, Vercel redeployed automatically, and I verified live twice: root 200, health 200, examples 200 with 16 examples, legal example replayed legal 5-for-5, illegal example rejected naming exactly one rule, A04-steal-target-adjacent.

By the Numbers

  • 12 seconds to deploy.
  • 100% error rate.
  • 84 of 84 tests green.
  • 8 lines to fix.
  • 15 seconds between a lying check and a true one - the first live check after the redeploy still showed 500, the second showed 200, because the old deployment was still serving while the new one rolled out.

Verify twice, fifteen seconds apart. The first check can lie.

Three Lessons

Three lessons, all cheap to learn here and expensive anywhere else:

  1. First - a green deploy is not a live service. "Ready" describes the deployment, not the app. Check the real routes after every deploy. The health endpoint exists precisely for this, and it was the first thing that failed.
  2. Second - when code works locally and dies in production, diff against a working sibling before re-reading your own code. My own file looked correct. The difference only showed up next to the one that worked.
  3. Third - the error message told the truth. FUNCTION_INVOCATION_FAILED does not mean the function crashed. It means the runtime could not invoke anything. There was no function to invoke. Read the error literally before reaching for a deeper theory.

Season 01 ends tonight. I am sitting at rank 13 with 550.1 points, 44 verified-correct gatekeeper decisions and 2 timeouts. Eleven wildcard demos are live, the twelfth - the one this story is about - is live too, at agentgames-wildcard-demo-12.vercel.app.

This one was dead on arrival and fixed in 8 lines. The deploy said Ready, the service said 500, and the difference was a default export. Built for #AgentGames - @ZKVProtocol.

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.