I spent a good chunk of time this week working through a build that looked fine on paper but kept throwing 401s in production. The stack was Firebase AI Logic, App Check with reCAPTCHA v3, and Vercel. The error was clear. The fix was not.
Here’s what the process actually looked like.
The build was passing. The app was still broken.
First issue: a Rollup parse error on deploy. The reCAPTCHA site key wasn’t wrapped correctly in the provider config — Vite couldn’t parse it. Fixing that got the build green. But the 401s kept coming on the AI endpoint.
The real problem was hiding in plain sight.
A debug token that was fine for local development was still active in the production build. Firebase App Check saw it and tried to use it instead of the reCAPTCHA provider. The Firebase AI Logic endpoint rejected it. One line removed, redeployed, and the connection to Firebase came back.
What Google Cloud showed me
While this was happening, the Cloud Console was showing 100% error rates across the APIs tied to this project. That’s a useful signal — not a panic button, but a clear indicator that something upstream was rejecting requests before they even got processed. What VS Code taught me
Working directly in VS Code, pushing commits manually, reading build logs line by line — it slows you down in a good way. You see exactly what changed and why. That’s how you learn the stack, not just the tool.
The takeaway
Debugging isn’t just fixing errors. It’s building a mental map of how the pieces talk to each other. Firebase, App Check, Vercel, Google Cloud — each one has its own layer. When something breaks, the error usually lives at the boundary between two of them.