-
Notifications
You must be signed in to change notification settings - Fork 431
fix(astro): Automatically use CSR Show component for prerendered pages #7710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 53495be The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
📝 WalkthroughWalkthroughAdds a changeset documenting a patch release for 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@packages/astro/src/astro-components/control/Show.astro`:
- Around line 25-28: Guard access to Astro.locals.auth when computing
shouldUseCSR to avoid crashes on prerendered pages: change the logic that sets
shouldUseCSR (currently using isStatic !== undefined ? isStaticOutput(isStatic)
: !Astro.locals.auth) to first detect prerendered context (e.g., via
isPrerenderedPage or by checking Astro.locals existence) and only read
Astro.locals.auth when safe; keep the fallback to isStaticOutput(isStatic) when
isStatic is provided and preserve selecting ShowComponent = shouldUseCSR ?
ShowCSR : ShowSSR. Also add unit/integration tests that verify Show renders with
CSR when runtime auth is present, with SSR when not, and that prerendered pages
do not throw when Astro.locals is undefined.
jacekradko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
![]()
Description
Port of #7708 but using the
<Show>componentChecklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Summary by CodeRabbit
Bug Fixes
New Features
Tests
Chores
✏️ Tip: You can customize this high-level summary in your review settings.