Skip to content

fix(dashboard): guard Clerk SignInButton during SSG without ClerkProvider - #2526

Merged
sanjay-kv merged 1 commit into
recodehive:mainfrom
bobby404-K:fix/ssg-clerk-signin-crash
Nov 15, 2026
Merged

sanjay-kv merged 1 commit into
recodehive:mainfrom
bobby404-K:fix/ssg-clerk-signin-crash

Conversation

@bobby404-K

Copy link
Copy Markdown
Member

Description

Fixes #2522

Type of Change

  • New feature (e.g., new page, component, or functionality)
  • Bug fix (non-breaking change that fixes an issue)
  • UI/UX improvement (design, layout, or styling updates)
  • Performance optimization (e.g., code splitting, caching)
  • Documentation update (README, contribution guidelines, etc.)
  • Other (please specify):

Changes Made

  • Guard Clerk <SignInButton> during SSG:
    • In src/components/dashboard/Sidebar/DashboardSidebar.tsx, checked if clerkPublishableKey exists before rendering @clerk/react's <SignInButton>. If Clerk is not configured or during build-time SSG where ClerkProvider is not mounted, render a standard accessible button fallback.
    • In src/components/dashboard/overview/SignedOutHero.tsx, similarly guarded <SignInButton> with a check for clerkPublishableKey.
  • Eliminate SSG build crash:
    • Resolves @clerk/react: SignInButton can only be used within the <ClerkProvider /> component error that previously broke static HTML generation for /updates/ and all 28 /learn/* docs pages when building without secrets in standard CI environments.
    • Verified npm run build generates all static HTML pages cleanly with exit code 0.

Dependencies

  • None

Checklist

  • My code follows the style guidelines of this project.
  • I have tested my changes across major browsers and devices
  • My changes do not generate new console warnings or errors .
  • I ran npm run build and attached screenshot(s) in this PR.
  • This is already assigned Issue to me, not an unassigned issue.

@vercel

vercel Bot commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

@bobby404-K is attempting to deploy a commit to the recode Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown

Thank you for submitting your pull request! 🙌 We'll review it asap. The estimated time for response is 5–8 hrs.

In the meantime, please provide all necessary screenshots and make sure you run - npm build run , command and provide a screenshot, if it's a Video -LEGEND, which helps speed up the review. If you have questions, reach out to LinkedIn. You can see in our Leaderboard in 20 min from now!😊

Note: I maintain the repo issue every day twice at 8:00 AM IST and 9:00 PM IST. If your PR goes stale for more than one day, you can tag and comment on this same issue by tagging @sanjay-kv.

We are here to help you on this journey of open source. Consistent 20 contributions are eligible for sponsorship 💰

🎁 check our list of amazing people we sponsored so far: GitHub Sponsorship. ✨

📚Your perks for contribution to this community 👇🏻

  1. Get free Consultation after 5 PR: Mentorship for free.

  2. Get the Ebook for free after 10 PR: You can tag me in Discussion to get the same. Data Science cheatsheet for Beginners.

  3. Check out this weekly Newsletter: Sanjay's Newsletter.

Thanks again for your contribution! 😊

@github-actions github-actions Bot added in-review The current changes are in review and would need approval and testing before merging level 1 10 points recode this is label for leaderboard labels Nov 15, 2026
@github-actions github-actions Bot added this to the recode:launch 3.0 milestone Nov 15, 2026
@github-actions

Copy link
Copy Markdown

✅ Synchronized metadata from Issue #2522:

  • Labels: level 1, recode
  • Milestone: None

@bobby404-K bobby404-K closed this Nov 15, 2026
@bobby404-K bobby404-K reopened this Nov 15, 2026
@bobby404-K
bobby404-K marked this pull request as draft November 15, 2026 07:39
@github-actions

Copy link
Copy Markdown

✅ Synchronized metadata from Issue #2522:

  • Labels: level 1, recode
  • Milestone: None

@bobby404-K
bobby404-K marked this pull request as ready for review November 15, 2026 07:40
@vercel

vercel Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated
recode-website Ready Ready Preview Nov 15, 2026 10:03am UTC

@sanjay-kv
sanjay-kv merged commit 42e81fa into recodehive:main Nov 15, 2026
12 checks passed

This branch was successfully deployed

1 active deployment
Preview — 7c72afce Deployed Nov 15, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in-review The current changes are in review and would need approval and testing before merging level 1 10 points recode this is label for leaderboard

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

🐞[Bug]: Build-time SSG crash across 29 routes caused by Clerk SignInButton without ClerkProvider

2 participants