@clerk/react: with a preloaded Clerk instance, hooks are not loaded on the first render and <ClerkLoaded> never renders
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 58/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- react, typescript
調査の方向性
Start by locating ClerkProvider, useAuth(), and ClerkLoaded in the React package, then trace how a preloaded Clerk instance initializes provider state and notifies subscribers. Reproduce with the listed package versions and the three steps in the issue. Done means the first render reflects the loaded instance and ClerkLoaded renders; the issue does not name a test file.
索引モデルが issue の本文から書いたものです。
説明
Related: #8569 (a preloaded instance passed to <ClerkProvider Clerk={clerk}> skips the UI load). We work around that by passing the UI at our own clerk.load({ ui: { ClerkUI } }). That leaves this gap.
Problem
With a preloaded instance passed as <ClerkProvider Clerk={clerk}>:
- On the first render,
useAuth()returnsisLoaded: falseanduseOrganization()has no membership, although the instance is already loaded. They become loaded one tick later, when the provider takes the instance over. <ClerkLoaded>does not re-render when that happens, so it cannot be used to wait for it.
A page that reads the role on its first render (for example, an admin-only route on a full page load) sees "not an admin" and redirects away.
Repro
@clerk/clerk-js 6.42, @clerk/react 6.18, @clerk/ui 1.42.
const clerk = new Clerk(pk); await clerk.load({ ui: { ClerkUI: ui.ClerkUI } });beforecreateRoot.- Render
<ClerkProvider Clerk={clerk}><Probe /></ClerkProvider>. - In
Probe, loguseAuth().isLoaded: the first render logsfalse. WrapProbein<ClerkLoaded>and it never renders.
Proposal
With a loaded instance, the provider starts with isLoaded: true and the session, user and organization already set. Or <ClerkLoaded> re-renders when the provider becomes loaded.
Our workaround
One wrapper at the root renders the app only when useAuth().isLoaded is true.
(issue generated with AI assistance)
- 主要言語
- TypeScript
- スター
- 1.8k
- フォーク
- 492
- 平均マージ
- 1日 7時間
- マージ済み PR(30日)
- 357
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
clerk/javascript のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
clerk/javascript#10708 ·
メンテナーはふだん 1 日以内に返信
-
Built-in reverification dialog lacks an accessible name (aria-dialog-name)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
clerk/javascript#10548 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
clerk/javascript#10547 ·
メンテナーはふだん 1 日以内に返信
-
<SignIn />: first "Use email" click switches back to phone when `initialValues.phoneNumber` is set対応中かも @twicestruck が 20 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
clerk/javascript#10487 ·
メンテナーはふだん 1 日以内に返信
-
useLoadedIsomorphicClerk misses "ready" when a ClerkProvider remounts after clerk-js has loaded — <ClerkLoading> never resolves再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
clerk/javascript#10462 ·
メンテナーはふだん 1 日以内に返信
clerk/javascript の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
vercel-labs/ui#809 ·
メンテナーはふだん 1 日以内に返信
-
bot:ai-assisted component:platform-js status:untriaged
難易度 1/5 1時間未満 初心者へのやさしさ 74/100
midnightntwrk/platform-js#38 ·
-
[bug] Second false positive on high-cost plugin alert: detection only compares patch entry id, community plugin dsh-auto | [bug] 高成本插件告警第二次误报:检测只比对 patch 条目 id,社区插件 dsh-auto-review 被认成 @deepseek-ai/dsh-experimental-auto-review対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
ranxianglei/billion-context#7068 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
mybigday/whisper.rn#348 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
six-group/six-webcomponents#600 ·