clerk/javascript

React Native @clerk/clerk-expo is not working as expected

SherifMoShalaby opened this issue ยท 22 comments

Preliminary Checks

Reproduction

https://github.com/Galaxies-dev/whatsapp-clone-react-native

Publishable key

pk_test_cG93ZXJmdWwtcGVnYXN1cy0yNi5jbGVyay5hY2NvdW50cy5kZXYk

Description

Steps to reproduce:

  1. Clone the provided Repo
  2. add .env file & add EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY={the one provided in the issue from the "Publishable key"}
  3. npm install
  4. npx expo run:ios

Expected behavior:

The application to work as before adding the ``````

Actual behavior:

After adding

<ClerkProvider publishableKey={process.env.clerkPublishableKey}>

The application is now giving me: "cannot find native module ExpoApplication"

328293412-75b15489-c4e0-4369-9a6e-2d2ffc55ce2d

Environment

System:
    OS: macOS 14.4.1
    CPU: (12) arm64 Apple M2 Max
    Memory: 5.13 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.20.2 - ~/.nvm/versions/node/v18.20.2/bin/node
    npm: 10.5.0 - ~/.nvm/versions/node/v18.20.2/bin/npm
    Watchman: 2024.04.22.00 - /opt/homebrew/bin/watchman
  Browsers:
    Chrome: 124.0.6367.119
    Safari: 17.4.1

Just keep installing the packages. Seems like the @clerk/clerk-expo package doesn't declare all the native expo packages needed. Every time you see the error, run npx expo install expo-application (or expo-xxxx), rebuild and repeat until errors disappear

Get the same error and to fix it I added different packages, but then I get:

Error: Not a valid base64 encoded string length

This error is located at:
    in ClerkProvider (created by RootLayoutNav)
   ...

Probably Expo 51 isn't supported yet for Clerk (?)

Possibly related, but no idea: expo/expo#26570 (comment)

Get the same error and to fix it I added different packages, but then I get:

Error: Not a valid base64 encoded string length

This error is located at:
    in ClerkProvider (created by RootLayoutNav)
   ...

Probably Expo 51 isn't supported yet for Clerk (?)

Right after upgrading the Expo from 50 to 51
I'm receiving the same error Error: Not a valid base64 encoded string length

No code changes besides following Expo steps to upgrade that is, installing latest and install --fix

If you're getting Error: Not a valid base64 encoded string length, it seems to be related to Expo v51. The Clerk team is aware of it and working on a fix. Current discussion is on Discord here: https://discord.com/channels/856971667393609759/1234973673946087534

If you're getting Error: Not a valid base64 encoded string length, it seems to be related to Expo v51. The Clerk team is aware of it and working on a fix. Current discussion is on Discord here: https://discord.com/channels/856971667393609759/1234973673946087534

@statico I am not able to see this discussion, does it still exist?

Any updates on this? I would really like to be able to use my app again with sdk 51

Any update here?

@statico I am not able to see this discussion, does it still exist?

@vflorrez1 @leo-mangold You have to be a member of the Clerk Discord to see it. There doesn't appear to be a fixed invite URL (thanks, Discord) but Googling found me this: https://discord.com/invite/b5rXHjAg7A

There's a PR in progress: #3354

I'm having very similar problems like this just submitted an issue aswell

I'm facing the same problem as well

Potentially resolved by #3326, which removes expo-application as a peer dependency.

I can confirm that this resolves the issue!

This should be fixed by #3326 and was published with @clerk/clerk-expo@1.1.0.

Please install the latest version of @clerk/clerk-expo in order to fix your issue:

npm install @clerk/clerk-expo@latest

This issue is not yet resolved as of today 14may2024 if any one find the solution please help here

This issue is not yet resolved as of today 14may2024 if any one find the solution please help here

It was fixed on the latest version.

This issue is not yet resolved as of today 14may2024 if any one find the solution please help here

It was fixed on the latest version.

Thanks for reply i will check and inform you

run: npm install @clerk/clerk-expo@latest
its fixed now

run: npm install @clerk/clerk-expo@latest its fixed now

It didn't actually :)

This should be fixed by #3326 and was published with @clerk/clerk-expo@1.1.0.

Please install the latest version of @clerk/clerk-expo in order to fix your issue:

npm install @clerk/clerk-expo@latest

Still not working

run: npm install @clerk/clerk-expo@latest its fixed now

Still not working

I'm sorry to hear that! I haven't used clerk-expo in over 4 months idk if the issue is new or not but at the time it was fixed i recommend creating a new issue on there official repo like i did at the time