Skip to content

fix(my): render /my dynamically so Clerk auth() can read headers - #267

Merged
akeight merged 1 commit into
mainfrom
fix/my-force-dynamic
Aug 13, 2026
Merged

fix(my): render /my dynamically so Clerk auth() can read headers#267
akeight merged 1 commit into
mainfrom
fix/my-force-dynamic

Conversation

@akeight

@akeight akeight commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fixes the production-only 500 on /my for signed-in users.
  • Root cause: /my used export const revalidate = 3600 (ISR) while auth() reads request headers(). In a production build these conflict and headers() throws DYNAMIC_SERVER_USAGE, surfacing as a sanitized Server Components 500. Signed-out users were unaffected because middleware redirects them before the page runs auth().
  • Switches /my to export const dynamic = "force-dynamic", matching /auth and /api/tracker. Per-request rendering also keeps deadline-derived countdowns fresh (the original reason #47 set revalidate).
  • Removes the temporary diagnostic logging added to capture the exception.

Test plan

  • Merge to main; confirm Workers Builds deploys production.
  • With wrangler tail hackhq running, sign in via GitHub and land on /my in incognito.
  • GET /my returns Ok, no DYNAMIC_SERVER_USAGE, hub renders.
  • Signed-out GET /api/tracker returns 401.

Made with Cursor

Switch /my from ISR (revalidate) to force-dynamic. auth() reads request
headers, which threw DYNAMIC_SERVER_USAGE under static generation in a
production build (signed-in only; middleware redirects signed-out users
before the page runs). Also removes the temporary diagnostic logging.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Aug 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hackhq Ready Ready Preview Aug 13, 2026 3:49pm

Request Review

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
hackhq a7dffbf Commit Preview URL

Branch Preview URL
Aug 13 2026, 03:50 PM

@akeight
akeight merged commit de9c719 into main Aug 13, 2026
5 checks passed
@akeight
akeight deleted the fix/my-force-dynamic branch August 14, 2026 01:15
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