{"slug": "when-firebase-fights-back-debugging-app-check-google-cloud-and-a-broken-deploy", "title": "When Firebase Fights Back: Debugging App Check, Google Cloud, and a Broken Deploy", "summary": "A developer traced persistent 401 errors on a Firebase AI Logic endpoint to a leftover App Check debug token that remained active in the production build, overriding the reCAPTCHA v3 provider. A separate Rollup parse error caused by an incorrectly wrapped reCAPTCHA site key was fixed first, and Google Cloud Console showed 100% error rates across the project's APIs while requests were being rejected upstream.", "body_md": "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.\n\nHere’s what the process actually looked like.\n\nThe build was passing. The app was still broken.\n\nFirst 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.\n\nThe real problem was hiding in plain sight.\n\nA 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.\n\nWhat Google Cloud showed me\n\nWhile 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.\n\nWhat VS Code taught me\n\nWorking 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.\n\nThe takeaway\n\nDebugging 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.", "url": "https://wpnews.pro/news/when-firebase-fights-back-debugging-app-check-google-cloud-and-a-broken-deploy", "canonical_source": "https://dev.to/rcortez056/when-firebase-fights-back-debugging-app-check-google-cloud-and-a-broken-deploy-2nj9", "published_at": "2026-11-23 17:00:00+00:00", "updated_at": "2026-11-23 17:12:53.474046+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools"], "entities": ["Firebase", "Google Cloud", "Vercel", "reCAPTCHA", "VS Code", "Rollup", "Vite"], "also_reported_by": [], "takeaway": "Remove App Check debug tokens from production builds, since a lingering debug token can override the configured reCAPTCHA provider and cause the Firebase AI Logic endpoint to reject requests with 401s.", "recommendation": {"advice": "Strip App Check debug tokens from production builds and verify the active provider in Cloud Console error rates before assuming the AI endpoint itself is failing.", "playbook": "production-ops", "playbook_url": "https://wpnews.pro/playbooks/production-ops"}, "alternates": {"html": "https://wpnews.pro/news/when-firebase-fights-back-debugging-app-check-google-cloud-and-a-broken-deploy", "markdown": "https://wpnews.pro/news/when-firebase-fights-back-debugging-app-check-google-cloud-and-a-broken-deploy.md", "text": "https://wpnews.pro/news/when-firebase-fights-back-debugging-app-check-google-cloud-and-a-broken-deploy.txt", "jsonld": "https://wpnews.pro/news/when-firebase-fights-back-debugging-app-check-google-cloud-and-a-broken-deploy.jsonld"}}