Skip to content

Conversation

@jacekradko
Copy link
Member

@jacekradko jacekradko commented Jan 21, 2026

Summary

Fixes Stripe elements not loading by removing the billingEnabled gate from useStripeClerkLibs that was inadvertently added during SWR removal.

Root Cause

During the SWR removal (#7568), a useBillingHookEnabled() check was added to gate the Stripe SDK loading

The original SWR implementation loaded the Stripe SDK unconditionally without this gate.

Look at the request to stripe:

Screenshot 2026-01-21 at 4 06 21 PM

Test plan

  • Existing billing E2E tests pass
  • Verify Stripe elements load on Billing screen in staging

The SWR removal PR (#7568) inadvertently added a `billingEnabled` check
to `useStripeClerkLibs` that wasn't present in the original SWR
implementation. This caused Stripe elements to not load on the Billing
screen because the query was gated by:
- billing being enabled in environment settings
- user being authenticated
- clerk.loaded being true

The original SWR implementation loaded the Stripe SDK unconditionally.
This restores that behavior by removing the `useBillingHookEnabled`
check from the hook.
@changeset-bot
Copy link

changeset-bot bot commented Jan 21, 2026

🦋 Changeset detected

Latest commit: 3823115

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 20 packages
Name Type
@clerk/shared Patch
@clerk/agent-toolkit Patch
@clerk/astro Patch
@clerk/backend Patch
@clerk/chrome-extension Patch
@clerk/clerk-js Patch
@clerk/expo-passkeys Patch
@clerk/expo Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/localizations Patch
@clerk/msw Patch
@clerk/nextjs Patch
@clerk/nuxt Patch
@clerk/react-router Patch
@clerk/react Patch
@clerk/tanstack-react-start Patch
@clerk/testing Patch
@clerk/ui Patch
@clerk/vue Patch

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

@vercel
Copy link

vercel bot commented Jan 21, 2026

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

Project Deployment Review Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Jan 21, 2026 9:28pm

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 21, 2026

📝 Walkthrough

Walkthrough

The change removes the `useBillingHookEnabled` import and the `billingEnabled` gating flag from the `useStripeClerkLibs` hook. As a result, the Stripe clerk libs query is no longer conditionally blocked by the billing hook and can run unconditionally. No other logic, return types, or public export names were modified.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: removing the billingEnabled gate from useStripeClerkLibs hook to fix Stripe elements loading.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 21, 2026

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@7639

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@7639

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@7639

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@7639

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@7639

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@7639

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@7639

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@7639

@clerk/express

npm i https://pkg.pr.new/@clerk/express@7639

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@7639

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@7639

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@7639

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@7639

@clerk/react

npm i https://pkg.pr.new/@clerk/react@7639

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@7639

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@7639

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@7639

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@7639

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@7639

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@7639

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@7639

commit: 3823115

@jacekradko jacekradko merged commit a374c18 into main Jan 21, 2026
46 checks passed
@jacekradko jacekradko deleted the jacekradko/fix-stripe-libs-loading branch January 21, 2026 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants