A one-line syntax error stopped the game server on a chess site I built from starting. My deploy check missed it.
I built abcchess.org during an internship, and I still maintain it. People play, solve puzzles, take lessons, and coaches run real classes on it. The first commit was Create Next App, in January. Most of my commits since then start with "fix".
Why live games cannot live on serverless
Most of the site is a request and a response. You ask for a puzzle, the server answers. That side is a Next.js app on Vercel, with data in DynamoDB. Login started on Firebase and moved to Auth.js in September.
Live games are different. Two players share one board and a clock, and something has to keep that clock running for the whole game. A Vercel function only lives for a few seconds, so it is the wrong place for that work.
What went wrong
The game server would not start at all. I had mixed two operators in one line of JavaScript without parentheses. That is a syntax error, and Node refused to run the file. My deploy check also waited only two seconds, so it missed the failure. None of this broke locally. All of it broke in production. I fixed both.
School logins
The newer work is for schools. The login page has three entry points: individual, coach and school, and schools get class logins for their students. "Who is this" is easy. "Who is this, which class are they in, and who is allowed to see their games" is the hard part.
Takeaways
- Keep long-running state, like a game clock, off short-lived serverless functions.
- Deploy checks have to wait long enough to notice a process that never comes up.
If you have shipped a one-line syntax error to production, tell me what you changed after.
Originally published on my site.
Top comments (0)