Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@clerk/clerk-expo ExpoLinking native module not found. #4643

Open
4 tasks done
Zakisb opened this issue Nov 24, 2024 · 4 comments
Open
4 tasks done

@clerk/clerk-expo ExpoLinking native module not found. #4643

Zakisb opened this issue Nov 24, 2024 · 4 comments

Comments

@Zakisb
Copy link

Zakisb commented Nov 24, 2024

Preliminary Checks

Reproduction

a simple expo demo app

Publishable key

pk_test_Y2FsbS1mZXJyZXQtNjkuY2xlcmsuYWNjb3VudHMuZGV2JA

Description

  1. Had a working Expo app with @clerk/clerk-expo

  2. Reinstalled node modules and cleaned project:

  • Deleted node_modules
  • Removed iOS/Android folders
  • Deleted package-lock.json
  • Ran clean install
  1. After reinstall, expo-linking module is not found

  2. After inspection, error seems to be caused by clerk-expo package

Expected behavior:

  • Clerk should work normally after clean reinstall
  • expo-linking should function properly

Actual behavior:

  • Getting "native module not found" error for expo-linking
  • Issue appeared after clean reinstall
  • After debugging, the error appears to be caused by clerk
Screen.Recording.2024-11-24.at.3.34.11.PM.mp4

Environment

System:
    OS: macOS 14.0
    CPU: (10) arm64 Apple M1 Max
    Memory: 12.46 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.17.0 - ~/.nvm/versions/node/v20.17.0/bin/node
    Yarn: 1.22.22 - /opt/homebrew/bin/yarn
    npm: 10.8.2 - ~/.nvm/versions/node/v20.17.0/bin/npm
    pnpm: 9.12.3 - /opt/homebrew/bin/pnpm
    Watchman: 2024.11.18.00 - /opt/homebrew/bin/watchman
  Browsers:
    Brave Browser: 128.1.69.168
    Chrome: 131.0.6778.86
    Safari: 17.0
  npmPackages:
    @babel/core: ^7.25.2 => 7.26.0 
    @botpress/webchat: ^2.1.6 => 2.3.6 
    @clerk/clerk-expo: 2.2.30 => 2.2.30 
    @expo/config-plugins: ~8.0.0 => 8.0.11 
    @expo/metro-runtime: ~3.2.3 => 3.2.3 
    @expo/ngrok: ^4.1.0 => 4.1.3 
    @expo/prebuild-config: ^7.0.8 => 7.0.9 
    @expo/vector-icons: ^14.0.2 => 14.0.4 
    @gorhom/bottom-sheet: ^4.6.3 => 4.6.4 
    @hookform/resolvers: ^3.9.0 => 3.9.1 
    @kingstinct/react-native-healthkit: ^8.2.0 => 8.2.0 
    @radix-ui/react-label: ^2.0.2 => 2.1.0 
    @react-native-async-storage/async-storage: 1.23.1 => 1.23.1 
    @react-native-community/datetimepicker: 8.0.1 => 8.0.1 
    @react-native-masked-view/masked-view: 0.3.1 => 0.3.1 
    @react-navigation/native: ^6.0.2 => 6.1.18 
    @rn-primitives/dropdown-menu: ^1.0.3 => 1.1.0 
    @rn-primitives/progress: ^1.0.3 => 1.1.0 
    @rn-primitives/slot: ^1.0.3 => 1.1.0 
    @rn-primitives/tabs: ^1.0.3 => 1.1.0 
    @rn-primitives/types: ^1.0.3 => 1.1.0 
    @shopify/flash-list: 1.6.4 => 1.6.4 
    @shopify/react-native-skia: 1.2.3 => 1.2.3 
    @tanstack/react-query: ^5.40.1 => 5.61.3 
    @types/jest: ^29.5.12 => 29.5.14 
    @types/react: ~18.2.79 => 18.2.79 
    @types/react-native: ^0.72.8 => 0.72.8 
    @types/react-test-renderer: ^18.0.7 => 18.3.0 
    axios: ^0.27.2 => 0.27.2 
    babel-preset-expo: ^11.0.13 => 11.0.15 
    class-variance-authority: ^0.7.0 => 0.7.0 
    clsx: ^2.1.1 => 2.1.1 
    date-fns: ^3.6.0 => 3.6.0 
    expo: ^51.0.18 => 51.0.39 
    expo-av: ~14.0.6 => 14.0.7 
    expo-blur: ~13.0.2 => 13.0.2 
    expo-build-properties: ~0.12.4 => 0.12.5 
    expo-clipboard: ~6.0.3 => 6.0.3 
    expo-constants: ~16.0.2 => 16.0.2 
    expo-crypto: ~13.0.2 => 13.0.2 
    expo-dev-client: ~4.0.29 => 4.0.29 
    expo-file-system: ~17.0.1 => 17.0.1 
    expo-font: ~12.0.9 => 12.0.10 
    expo-health: ^0.0.0 => 0.0.0 
    expo-image-picker: ^15.0.7 => 15.0.7 
    expo-linear-gradient: ~13.0.2 => 13.0.2 
    expo-linking: ~6.3.1 => 6.3.1 
    expo-navigation-bar: ~3.0.7 => 3.0.7 
    expo-router: ~3.5.20 => 3.5.24 
    expo-secure-store: ~13.0.2 => 13.0.2 
    expo-sharing: ~12.0.1 => 12.0.1 
    expo-splash-screen: ~0.27.5 => 0.27.7 
    expo-status-bar: ~1.12.1 => 1.12.1 
    expo-system-ui: ~3.0.7 => 3.0.7 
    expo-updates: ~0.25.26 => 0.25.27 
    expo-video: ^1.1.10 => 1.2.7 
    expo-web-browser: ~13.0.3 => 13.0.3 
    groq-sdk: ^0.5.0 => 0.5.0 
    https-browserify: ^0.0.1 => 0.0.1 
    jest: ^29.4.0 => 29.7.0 
    jest-expo: 51.0.3 => 51.0.4 
    jwt-decode: ^4.0.0 => 4.0.0 
    lodash: ^4.17.21 => 4.17.21 
    lottie-react-native: 6.7.0 => 6.7.0 
    lucide-react-native: ^0.379.0 => 0.379.0 
    nanoid: ^5.0.7 => 5.0.8 
    nativewind: ^4.0.33 => 4.1.23 
    nodemon: ^3.1.1 => 3.1.7 
    patch-package: ^8.0.0 => 8.0.0 
    react: 18.2.0 => 18.2.0 
    react-dom: 18.2.0 => 18.2.0 
    react-hook-form: ^7.52.2 => 7.53.2 
    react-native: 0.74.5 => 0.74.5 
    react-native-animatable: ^1.4.0 => 1.4.0 
    react-native-calendars: ^1.1307.0 => 1.1307.0 
    react-native-chart-kit: ^6.12.0 => 6.12.0 
    react-native-color-matrix-image-filters: ^6.0.9 => 6.0.9 
    react-native-crypto: ^2.2.0 => 2.2.0 
    react-native-date-picker: ^5.0.4 => 5.0.7 
    react-native-element-dropdown: ^2.12.1 => 2.12.2 
    react-native-fetch-api: ^3.0.0 => 3.0.0 
    react-native-gesture-handler: ~2.16.1 => 2.16.2 
    react-native-health: ^1.1.0 => 1.19.0 
    react-native-polyfill-globals: ^3.1.0 => 3.1.0 
    react-native-randombytes: ^3.6.1 => 3.6.1 
    react-native-reanimated: ~3.10.1 => 3.10.1 
    react-native-reanimated-carousel: ^3.5.1 => 3.5.1 
    react-native-safe-area-context: 4.10.5 => 4.10.5 
    react-native-screens: 3.31.1 => 3.31.1 
    react-native-sse: ^1.2.1 => 1.2.1 
    react-native-svg: 15.2.0 => 15.2.0 
    react-native-svg-transformer: ^1.5.0 => 1.5.0 
    react-native-toast-message: ^2.2.1 => 2.2.1 
    react-native-web: ~0.19.10 => 0.19.13 
    react-native-webview: 13.8.6 => 13.8.6 
    react-test-renderer: 18.2.0 => 18.2.0 
    react-timer-hook: ^3.0.7 => 3.0.8 
    tailwind-merge: ^2.3.0 => 2.5.4 
    tailwindcss: ^3.3.2 => 3.4.15 
    tailwindcss-animate: ^1.0.7 => 1.0.7 
    typescript: ~5.3.3 => 5.3.3 
    url: ^0.10.3 => 0.10.3 
    use-debounce: ^10.0.4 => 10.0.4 
    uuid: ^10.0.0 => 10.0.0 
    victory-native: ^37.0.3-next.0 => 37.3.2 
    web-streams-polyfill: ^3.2.1 => 3.3.3 
    zod: ^3.23.8 => 3.23.8 
    zustand: ^4.5.4 => 4.5.5
@Zakisb Zakisb added the needs-triage A ticket that needs to be triaged by a team member label Nov 24, 2024
@wobsoriano
Copy link
Member

Hello! Can you try running npx expo-doctor and npx expo install --check and share any details you get if that's fine? Thank you!

@Zakisb
Copy link
Author

Zakisb commented Nov 25, 2024

@wobsoriano Hey, i finally fixed the issue. i posted on discord. i will answer here for anyone having this problem in the future.

the clerk expo version 2.2.30 was by default installing [email protected] , [email protected], @expo/[email protected] by default. these aren't compatible with expo sdk 51. i had to force clerk to use older versions for the linking to work.

If you're using SDK 51, do not install clerk-expo directly via npm without adding these to your package.json file

"overrides": {
    "@clerk/clerk-expo": {
      "expo-auth-session": "~5.5.2",
      "@expo/config-plugins": "~8.0.0",
      "expo-linking": "~6.3.1",
      "expo-constants": "~16.0.2"
    }
  },

Also run

The reason being as i said is because expo-linking 7.0 version is not compatible with expo sdk 51. it will crash your app. and by default clerk uses expo-auth as dev dependency which uses expo-linking under the hood. You also it will install expo config plugins 9 which is the latest version.

Additional : If you're cloning the clerk-expo starter template from their repo, the reason it works is because the package-lock.json has expo-auth@5 and expo linking 6.3.1 installed. if you remove package-lock.json and node modules and re install again it won't work. Hope that helps

Screenshot 2024-11-25 at 5 28 17 PM

@wobsoriano
Copy link
Member

wobsoriano commented Nov 25, 2024

Thanks @Zakisb! I've updated the quickstart by cleaning up the lockfile and reinstalling with the latest @clerk/clerk-expo. I can confirm the app throws that error.

Our package has a peer dependency of expo-auth-session >= 5, and npm installs version 6 by default (which is not supported by SDK 51). To fix this in your SDK 51 project, pin [email protected] in your dependencies for now.

We'll update our quickstart for SDK 52 🫡

Thank you!

@wobsoriano wobsoriano added expo and removed needs-triage A ticket that needs to be triaged by a team member labels Nov 25, 2024
@Zakisb
Copy link
Author

Zakisb commented Nov 25, 2024

You're welcome !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants