fix(expo): Resolve Android native modules optionally#9203
Conversation
🦋 Changeset detectedLatest commit: 2881086 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/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@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: |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAndroid Expo native module specs now use optional loading, allowing missing Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/expo/src/specs/__tests__/androidSpecs.test.ts`:
- Around line 8-22: The android native module specs tests only cover missing
modules; extend the mocked requireOptionalNativeModule path to return fake
modules for each expected module name and assert ClerkExpoSpec and
ClerkGoogleSignInSpec preserve those modules. Keep the existing null/error
tests, and ensure the name-sensitive mock also catches incorrect native module
identifiers.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: be63474d-8af5-4729-9b28-a11e3edab236
📒 Files selected for processing (4)
.changeset/fix-android-optional-native-module.mdpackages/expo/src/specs/NativeClerkGoogleSignIn.android.tspackages/expo/src/specs/NativeClerkModule.android.tspackages/expo/src/specs/__tests__/androidSpecs.test.ts
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
clerk/clerk_go(manual)clerk/dashboard(manual)clerk/accounts(manual)clerk/backoffice(manual)clerk/clerk(manual)clerk/clerk-docs(manual)clerk/cloudflare-workers(manual)
API Changes Report
Summary
No API Changes DetectedAll packages have stable APIs with no detected changes. Report generated by Break Check Last ran on |
Description
On Android, the native module specs used
requireNativeModule, which throws at import time. SinceClerkProviderimports that chain unconditionally, every Android app crashed at startup withCannot find native module 'ClerkExpo'when the module wasn't compiled in (Expo Go), even for JavaScript-only flows.iOS already used
requireOptionalNativeModule. This makes Android match, letting the existing null guard degrade gracefully.Fixes #9197
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change