Repository navigation
fix(web): exclude PostHog proxy from i18n middleware - #1626
Conversation
The next-intl middleware added in cf75da8 intercepts /cmuxterm/* requests (the PostHog reverse proxy), causing analytics to break since March 12. Add cmuxterm to the negative lookahead so proxy requests bypass i18n.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughUpdated middleware matcher to exclude Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
Next.js 16 renamed middleware.ts to proxy.ts. Migrate to the new convention since we're on Next.js 16.1.6.
Replace the Next.js rewrites-based proxy (/cmuxterm -> us.i.posthog.com) with PostHog's managed reverse proxy at r.cmux.dev. This removes the rewrites from next.config.ts entirely and eliminates the proxy.ts matcher conflict that caused the analytics regression.
There was a problem hiding this comment.
1 issue found across 3 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="web/proxy.ts">
<violation number="1">
P1: `cmuxterm` was removed from the exclusion matcher, so `/cmuxterm/*` is routed through i18n middleware again and the PostHog proxy path will be intercepted.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
* fix(web): exclude PostHog proxy path from i18n middleware The next-intl middleware added in 1476b2e intercepts /cmuxterm/* requests (the PostHog reverse proxy), causing analytics to break since March 12. Add cmuxterm to the negative lookahead so proxy requests bypass i18n. * refactor(web): rename middleware.ts to proxy.ts for Next.js 16 Next.js 16 renamed middleware.ts to proxy.ts. Migrate to the new convention since we're on Next.js 16.1.6. * feat(web): migrate PostHog to managed reverse proxy at r.cmux.dev Replace the Next.js rewrites-based proxy (/cmuxterm -> us.i.posthog.com) with PostHog's managed reverse proxy at r.cmux.dev. This removes the rewrites from next.config.ts entirely and eliminates the proxy.ts matcher conflict that caused the analytics regression. --------- Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com>
Summary
/cmuxterm/*requests (PostHog reverse proxy), breaking all analytics since March 12.cmuxtermto the middleware matcher's negative lookahead so PostHog proxy requests bypass i18n routing.Testing
Related
Summary by cubic
Switch PostHog to the managed reverse proxy at https://r.cmux.dev and remove the
/cmuxtermrewrites, eliminating the i18n matcher conflict and restoring analytics. Rename the middleware toweb/proxy.tsfor Next.js 16; locale detection for other routes is unchanged.Written for commit 4e6a0b8. Summary will update on new commits.
Summary by CodeRabbit