Skip to content

fix: restore Google sign-in on Cloudflare Workers - #101

Merged
legions-developer merged 2 commits into
mainfrom
gurbinder/fix-google-sign-in
Oct 5, 2026
Merged

legions-developer merged 2 commits into
mainfrom
gurbinder/fix-google-sign-in

Conversation

@legions-developer

Copy link
Copy Markdown
Owner

Google sign-in on invoicely.gg stopped before redirecting to Google after #100: the auth routes returned HTTP 500 and the button stayed disabled. Reproduced with Computer Use in Dia and in the built Cloudflare Worker.

Sentry 10.76.0 imports a build helper from its server runtime entry. That helper eagerly calls createRequire(__filename), but OpenNext supplies an empty filename inside the Worker bundle, crashing instrumentation startup before auth runs.

This change:

  • Applies a native Yarn patch to defer that build-only call in Sentry's CJS and ESM distributions, preserving the security upgrades.
  • Tracks the patch in webpack's cache dependencies so restored build caches cannot reuse the unpatched same-version package.
  • Handles returned and thrown sign-in errors, displays an accessible error, and re-enables the Google button for retry.
  • Adds three Sentry regression tests to yarn test:security and documents when to remove the temporary patch/pin.

Validation:

  • All 97 repository tests pass; immutable install, formatting and diff checks pass.
  • Clean and subsequent Cloudflare builds pass, including lint and TypeScript checks.
  • Actual local Worker: /api/auth/ok returns 200 JSON; unauthenticated /api/auth/get-session returns 200/null; an invalid social sign-in body returns 400 JSON instead of a startup 500.
  • Computer Use in Dia reproduces the production button freezing. The fixed local UI shows the failure message and allows a second attempt with placeholder credentials/database.

No database migration or Google OAuth credential change is required for this fix. A complete Google account login on production still needs verification after deployment; the local check uses placeholder credentials and does not claim that flow completed.

@coderabbitai

coderabbitai Bot commented Oct 5, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1fec6188-4d68-43c8-96cb-774e565af760
📥 Commits

Reviewing files that changed from the base of the PR and between 7b2bc13 and e91d638.

⛔ Files ignored due to path filters (2)
  • .yarn/patches/sentry-nextjs-npm-10.76.0-runtime.patch is excluded by !**/.yarn/**
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (5)
  • README.md
  • apps/web/next.config.ts
  • apps/web/src/components/layout/sidebar/navigation-user.tsx
  • package.json
  • scripts/sentry-worker-compat.test.mjs
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

Preview database and deployment

Commit: e91d6382dfe1

Migration command and Cloudflare build/deploy completed successfully. There may have been no pending migrations.

Cloudflare build logs

Migration status is inferred from the required migration hook and the overall Cloudflare result. Build logs contain the individual migration output.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://gurbinder-fix-google-sign-in.preview.invoicely.gg (commit e91d638)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://855eb198.preview.invoicely.gg e91d638 2026-10-05T18:14:37.339Z Visit the dashboard ↗

@legions-developer
legions-developer merged commit 820d3c5 into main Oct 5, 2026
3 of 4 checks passed
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

Production database and deployment

Commit: 820d3c51604f

Migration command and Cloudflare build/deploy completed successfully. There may have been no pending migrations.

Cloudflare build logs

Migration status is inferred from the required migration hook and the overall Cloudflare result. Build logs contain the individual migration output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant