javascript icon indicating copy to clipboard operation
javascript copied to clipboard

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

Open SherifMoShalaby opened this issue 1 year ago • 6 comments

Preliminary Checks

  • [X] I have reviewed the documentation: https://clerk.com/docs
  • [X] I have searched for existing issues: https://github.com/clerk/javascript/issues
  • [X] I have not already reached out to Clerk support via email or Discord (if you have, no need to open an issue here)
  • [X] This issue is not a question, general help request, or anything other than a bug report directly related to Clerk. Please ask questions in our Discord community: https://clerk.com/discord.

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

SherifMoShalaby avatar May 07 '24 11:05 SherifMoShalaby

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

sudowoodo200 avatar May 08 '24 15:05 sudowoodo200

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 (?)

shifenis avatar May 08 '24 16:05 shifenis

Possibly related, but no idea: https://github.com/expo/expo/issues/26570#issuecomment-2101078195

statico avatar May 08 '24 17:05 statico

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

NikoEscobar avatar May 08 '24 19:05 NikoEscobar

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 avatar May 08 '24 19:05 statico

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?

vflorrez1 avatar May 09 '24 19:05 vflorrez1

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

leo-mangold avatar May 10 '24 08:05 leo-mangold

Any update here?

csulit avatar May 10 '24 17:05 csulit

@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: https://github.com/clerk/javascript/pull/3354

statico avatar May 10 '24 18:05 statico

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

2salted avatar May 10 '24 20:05 2salted

I'm facing the same problem as well

soufianeelc avatar May 10 '24 21:05 soufianeelc

Potentially resolved by https://github.com/clerk/javascript/pull/3326, which removes expo-application as a peer dependency.

thiskevinwang avatar May 10 '24 22:05 thiskevinwang

I can confirm that this resolves the issue!

kwojtkowiak avatar May 11 '24 19:05 kwojtkowiak

This should be fixed by https://github.com/clerk/javascript/pull/3326 and was published with @clerk/[email protected].

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

npm install @clerk/clerk-expo@latest

LekoArts avatar May 13 '24 05:05 LekoArts

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

ravishukla21 avatar May 14 '24 14:05 ravishukla21

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.

csulit avatar May 14 '24 14:05 csulit

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

ravishukla21 avatar May 14 '24 14:05 ravishukla21

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

2salted avatar May 15 '24 09:05 2salted

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

It didn't actually :)

SherifMoShalaby avatar May 23 '24 20:05 SherifMoShalaby

This should be fixed by #3326 and was published with @clerk/[email protected].

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

npm install @clerk/clerk-expo@latest

Still not working

SherifMoShalaby avatar May 23 '24 20:05 SherifMoShalaby

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

Still not working

wesuRage avatar Oct 10 '24 16:10 wesuRage

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

2salted avatar Oct 10 '24 20:10 2salted