From fd83f579dac170b47dc48f2693554e3415323a2d Mon Sep 17 00:00:00 2001 From: Keiran Flanigan Date: Mon, 24 Mar 2025 11:54:15 -0700 Subject: [PATCH 1/2] fix(clerk-js): fix lazy-loading of `BillingPage` within `UserProfile` --- .../ui/components/UserProfile/UserProfileRoutes.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/clerk-js/src/ui/components/UserProfile/UserProfileRoutes.tsx b/packages/clerk-js/src/ui/components/UserProfile/UserProfileRoutes.tsx index 53d73a69de2..7a3a49f907d 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/UserProfileRoutes.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/UserProfileRoutes.tsx @@ -7,6 +7,12 @@ import { Route, Switch } from '../../router'; import { AccountPage } from './AccountPage'; import { SecurityPage } from './SecurityPage'; +const BillingPage = lazy(() => + import(/* webpackChunkName: "up-billing-page"*/ './BillingPage').then(module => ({ + default: module.BillingPage, + })), +); + export const UserProfileRoutes = () => { const { pages } = useUserProfileContext(); const { experimental } = useOptions(); @@ -15,12 +21,6 @@ export const UserProfileRoutes = () => { const isSecurityPageRoot = pages.routes[0].id === USER_PROFILE_NAVBAR_ROUTE_ID.SECURITY; const isBillingPageRoot = pages.routes[0].id === USER_PROFILE_NAVBAR_ROUTE_ID.BILLING; - const BillingPage = lazy(() => - import(/* webpackChunkName: "up-billing-page"*/ './BillingPage').then(module => ({ - default: module.BillingPage, - })), - ); - const customPageRoutesWithContents = pages.contents?.map((customPage, index) => { const shouldFirstCustomItemBeOnRoot = !isAccountPageRoot && !isSecurityPageRoot && index === 0; return ( From 5ae1cf8ef78caf1fa4f90da3f3b4ec673e838487 Mon Sep 17 00:00:00 2001 From: Keiran Flanigan Date: Mon, 24 Mar 2025 12:06:40 -0700 Subject: [PATCH 2/2] add changeset --- .changeset/common-melons-camp.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/common-melons-camp.md diff --git a/.changeset/common-melons-camp.md b/.changeset/common-melons-camp.md new file mode 100644 index 00000000000..07b2ea6aaf5 --- /dev/null +++ b/.changeset/common-melons-camp.md @@ -0,0 +1,5 @@ +--- +'@clerk/clerk-js': patch +--- + +Fix lazy-loading of `BillingPage` in `UserProfile`