Repository navigation
Description
Describe the bug
When running a production build (npm run build) in standard environments without VITE_CLERK_PUBLISHABLE_KEY, static site generation (SSG) crashes across 29 routes, failing the entire production build with exit code 1:
[ERROR] Error: Unable to build website for locale en.
[cause]: Error: Docusaurus static site generation failed for 31 paths:
- "/updates/"
- "/learn/"
- "/learn/github-for-beginners"
- "/learn/github-for-beginners/achievements"
- "/learn/github-for-beginners/codespaces"
... (27 additional /learn/* subpages)
[cause]: Error: @clerk/react: SignInButton can only be used within the <ClerkProvider /> component. Learn more: https://clerk.com/docs/components/clerk-provider
at Object.throwMissingClerkProviderError (server.bundle.js:71077:10)
at server.bundle.js:70640:16
at useAssertWrappedByClerkProvider (server.bundle.js:74150:4)
Root Cause:
In src/theme/Root.tsx, when clerkPublishableKey is empty or omitted at build time, Root intentionally renders children directly without wrapping them in <ClerkProvider>:
if (!clerkPublishableKey) {
return content;
}
return <ClerkProvider ...>{content}</ClerkProvider>;However, both /updates/ and the /learn/* docs section render <DashboardSidebar>. Inside src/components/dashboard/Sidebar/DashboardSidebar.tsx, hook calls (useUser, useClerk) were placed in a try / catch, but in the JSX at lines 198–210, <SignInButton mode="modal"> is rendered unconditionally:
<SignInButton mode="modal">
<button type="button" className="dashboard-rail-signin" aria-label="Sign in with GitHub">
<GithubMark />
{!collapsed && <span>Sign in with GitHub</span>}
</button>
</SignInButton>Because <SignInButton> is a component imported from @clerk/react, rendering it without an active <ClerkProvider> context throws Error: @clerk/react: SignInButton can only be used within the <ClerkProvider /> component during static HTML generation. This aborts SSG for every page hosting the sidebar and terminates the build.
The same unhandled <SignInButton> rendering exists in src/components/dashboard/overview/SignedOutHero.tsx and src/components/dashboard/LeaderBoard/Rail.tsx.
Expected behavior
DashboardSidebar.tsx, SignedOutHero.tsx, and Rail.tsx should verify whether Clerk authentication is configured and available (e.g. checking siteConfig.customFields?.clerkPublishableKey). When Clerk is not enabled or during static site generation without ClerkProvider, they should render a standard sign-in button rather than invoking @clerk/react's <SignInButton> component.
Measured Before vs. After:
- Before:
npm run buildexits with code 1; static site generation fails for 29+ routes. - After:
npm run buildexits with code 0; all pages generate static HTML successfully.
Activity
github-actions commentedon Nov 15, 2026
Thanks for opening this issue! 🎉 We'll look into it as soon as possible, estimated time for response is 5–8 hrs.
Don't raise PR unless assigned to you.
In the meantime, please provide all necessary details and context to your issue — screenshots or videos of your changes help speed up the review and assignment. If you have questions, reach out to LinkedIn. Your contributions are highly appreciated!😊
Note: I maintain the repo issue every day twice at 8:00 AM IST and 9:00 PM IST. If your issue 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 contributions are eligible for sponsorship 💰
🎁 check our list of amazing people we sponsored so far: GitHub Sponsorship. ✨
📚Resources which can help you know more about Github 👇🏻
End to End GitHub Beginner Playlist: GitHub Playlist.
Build your GitHub Profile: GitHub Profile Optimisation.
GitHub Handbook for dummies: GitHub Blog for Beginners.
github-actions commentedon Nov 15, 2026
Thanks for opening this issue. To help maintainers review it faster, please add the missing details below:
bobby404-K commentedon Nov 15, 2026
assign me @sanjay-kv
github-actions commentedon Nov 15, 2026
✅ This issue has been closed. Thank you for your contribution!