You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeError: Cannot read property '__internal_toSnapshot' of undefined when using __experimental_resourceCache in ClerkProvider (Expo App Offline Support) #6010
I have not already reached out to Clerk support via email or Discord (if you have, no need to open an issue here)
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.
Set up with tokenCache and __experimental_resourceCache props: Note: Neither @clerk/clerk-expo/resource-cache (after before 2.9.0) nor @clerk/clerk-expo/secure-store (before 2.9.0) works:
<ClerkProvidertokenCache={tokenCache}__experimental_resourceCache={resourceCache}>{/* children */}</ClerkProvider>
App should support offline mode without throwing runtime errors when using __experimental_resourceCache.
Actual behavior:
App throws an error:
[TypeError: Cannot read property '__internal_toSnapshot' of undefined]
This happens as soon as signIn.create(...) is called, only when __experimental_resourceCache is present. When that prop is removed, everything works correctly.
Offline support is super important for our app since many users work in poor connectivity areas. Not sure if this is something wrong in my setup, the SDK, or how I'm using it. Any help or workaround would be awesome!
Preliminary Checks
I have reviewed the documentation: https://clerk.com/docs
I have searched for existing issues: https://github.com/clerk/javascript/issues
I have not already reached out to Clerk support via email or Discord (if you have, no need to open an issue here)
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/clerk/clerk-expo-quickstart
Publishable key
pk_test_ZmFpdGhmdWwtbW9ua2Zpc2gtNS5jbGVyay5hY2NvdW50cy5kZXYk
Description
Steps to reproduce:
__experimental_resourceCacheprops:Note: Neither
@clerk/clerk-expo/resource-cache(after before 2.9.0) nor@clerk/clerk-expo/secure-store(before 2.9.0) works:Expected behavior:
App should support offline mode without throwing runtime errors when using
__experimental_resourceCache.Actual behavior:
App throws an error:
This happens as soon as
signIn.create(...)is called, only when__experimental_resourceCacheis present. When that prop is removed, everything works correctly.Reproduction in clerk-expo-quickstart
clerk-expo-offline_rT83G6vh.mp4
Offline support is super important for our app since many users work in poor connectivity areas. Not sure if this is something wrong in my setup, the SDK, or how I'm using it. Any help or workaround would be awesome!
Thanks a lot for all the great work on this SDK!
Environment