fix(web): declare posthog-js as direct dep, surface build env to turbo#90
Conversation
- New migration 20260416120000_fix_company_suggestions_rls adds idempotent INSERT + SELECT-own-rows policies so /token-rich suggestion submission stops hitting 42501 RLS errors. - New migration 20260408232117_admin_model_share_exclude_retro_syncs filters admin_model_share_by_day to usage on/after each user's signup. - Resync earlier migration files to match the remote DB state after pull (no functional change; DB already at head). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
… turbo - apps/web imports posthog-js and posthog-js/react directly in PostHogProvider.tsx, but they were only installed transitively via @posthog/next. Turbopack refuses phantom deps, so Vercel builds have been failing since afff896 ("Module not found: Can't resolve 'posthog-js'"). Pin to 1.359.1 to match @posthog/next@0.1.0's peer. - Add the 7 server-only env vars (CLERK_SECRET_KEY, CLI_JWT_SECRET, ANTHROPIC_API_KEY, RESEND_API_KEY, RESEND_FROM_EMAIL, UNSUBSCRIBE_SECRET, ADMIN_USER_IDS) to turbo.json's build env so they reach the Vercel build and stop triggering the turbo warning. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (15)
📝 WalkthroughWalkthroughMultiple Supabase migrations addressing RLS policies, authentication logic, and admin functionality; PostHog telemetry dependency addition to web app; and build environment configuration expansion to expose additional secrets. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested labels
Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Summary
Production has been broken since
afff896("feat: add PostHog web analytics...") with Turbopack error:posthog-jsis imported directly inPostHogProvider.tsxbut only installed transitively via@posthog/next. Turbopack rejects phantom deps — add it explicitly, pinned to1.359.1to match@posthog/next@0.1.0's peer.turbo.jsonwas missing 7 server-only env vars (CLERK_SECRET_KEY,CLI_JWT_SECRET,ANTHROPIC_API_KEY,RESEND_API_KEY,RESEND_FROM_EMAIL,UNSUBSCRIBE_SECRET,ADMIN_USER_IDS); turbo strips them from the build env and emits a[warn]block on every Vercel build.Last green prod deploy:
9ca6b45. After this merges, prod should go green again.Test plan
bun run buildat repo root passes locally with placeholder env vars🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
Bug Fixes
New Features
Chores