Skip to content

fix: resolve mock portal hydration error on staging#104

Merged
kevinrutledge merged 1 commit intodevelopfrom
fix/mock-portal-hydration
Mar 28, 2026
Merged

fix: resolve mock portal hydration error on staging#104
kevinrutledge merged 1 commit intodevelopfrom
fix/mock-portal-hydration

Conversation

@kevinrutledge
Copy link
Copy Markdown
Collaborator

@kevinrutledge kevinrutledge commented Mar 28, 2026

Developer

Kevin Rutledge

What changed?

Split the mock portal into a server component wrapper + client component to fix React hydration error #418 on the Vercel staging site.

The mock portal was a "use client" component that checked process.env.STAGING, but non-NEXT_PUBLIC_ env vars are undefined in the browser. The server rendered the form (saw STAGING=true), the client rendered "not available" (STAGING was undefined), causing a hydration mismatch.

The fix follows the existing server/client pattern used throughout the codebase (e.g. home/page.tsx -> home-content.tsx):

  • page.tsx is now a server component with the STAGING guard
  • mock-portal-content.tsx is the client component with all the form logic

How to test

  1. Run npm test - 237 tests pass
  2. Run npm run build - succeeds
  3. Deploy to staging - /dev/mock-portal loads without hydration error
  4. On production (without STAGING=true) - shows "Not available in production"

Checklist

@kevinrutledge kevinrutledge merged commit c66fb2d into develop Mar 28, 2026
2 checks passed
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