fix(clerk-js): static QueryClient import in native entry point#8170
Closed
jacekradko wants to merge 3 commits intochris/fix-query-client-rnfrom
Closed
fix(clerk-js): static QueryClient import in native entry point#8170jacekradko wants to merge 3 commits intochris/fix-query-client-rnfrom
jacekradko wants to merge 3 commits intochris/fix-query-client-rnfrom
Conversation
Move the synchronous QueryClient fix from the Expo package into clerk-js itself by creating a dedicated native entry point (index.native.ts) that statically imports QueryClient and overrides the lazy getter on the Clerk prototype. This fixes the root cause at the bundler level without affecting other dynamic imports.
|
| Name | Type |
|---|---|
| @clerk/clerk-js | Patch |
| @clerk/chrome-extension | Patch |
| @clerk/expo | Patch |
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
4 tasks
…rity test Eliminate duplicated exports in index.native.ts by using 'export * from ./index'. Add a test that verifies the native entry point exports match the base entry point.
Member
Author
|
Closing as this seems to be a more robust approach: #8087 (comment) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Alternative approach to fixing the React Native QueryClient issue (discussed in #8087):
index.native.ts) that statically importsQueryClientand overrides the lazy getter on theClerkprototypeclerkNativerspack variant at this new entry pointrequire('@tanstack/query-core')override increateClerkInstance.ts)@tanstack/query-coreas a direct dependency of@clerk/expoThis fixes the root cause at the bundler level — only the native build's entry point is affected, leaving other dynamic imports (cookieSuffix, debug, etc.) untouched.
Test plan
pnpm build)useOrganizationListand other query-based hooks return real data on React Native