Title: TypeError: Cannot read property '__internal_toSnapshot' of undefined when using __experimental_resourceCache in ClerkProvider (Expo App Offline Support) · Issue #6010 · clerk/javascript · GitHub
Open Graph Title: TypeError: Cannot read property '__internal_toSnapshot' of undefined when using __experimental_resourceCache in ClerkProvider (Expo App Offline Support) · Issue #6010 · clerk/javascript
X Title: TypeError: Cannot read property '__internal_toSnapshot' of undefined when using __experimental_resourceCache in ClerkProvider (Expo App Offline Support) · Issue #6010 · clerk/javascript
Description: 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 hav...
Open Graph Description: 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 ...
X Description: 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 ...
Opengraph URL: https://github.com/clerk/javascript/issues/6010
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"TypeError: Cannot read property '__internal_toSnapshot' of undefined when using __experimental_resourceCache in ClerkProvider (Expo App Offline Support)","articleBody":"### Preliminary Checks\n\n- [x] I have reviewed the documentation: https://clerk.com/docs\n\n- [x] I have searched for existing issues: https://github.com/clerk/javascript/issues\n\n- [x] I have not already reached out to Clerk support via email or Discord (if you have, no need to open an issue here)\n\n- [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.\n\n\n### Reproduction\n\nhttps://github.com/clerk/clerk-expo-quickstart\n\n### Publishable key\n\npk_test_ZmFpdGhmdWwtbW9ua2Zpc2gtNS5jbGVyay5hY2NvdW50cy5kZXYk\n\n### Description\n\n#### Steps to reproduce:\n\n1. Follow the official Clerk Expo [offline support guide](https://clerk.com/docs/references/expo/offline-support).\n2. Set up \u003cClerkProvider /> with tokenCache and `__experimental_resourceCache` props:\n**Note:** Neither `@clerk/clerk-expo/resource-cache` (after before 2.9.0) nor `@clerk/clerk-expo/secure-store` (before 2.9.0) works:\n\n```tsx\n \u003cClerkProvider tokenCache={tokenCache} __experimental_resourceCache={resourceCache}>\n {/* children */}\n \u003c/ClerkProvider>\n```\n\n3. Attempt to sign in using:\n\n```tsx\nconst signInResponse = await signIn.create({\n strategy: 'password',\n identifier: formData.email,\n password: formData.password,\n})\n```\n\n#### Expected behavior:\n\nApp should support offline mode without throwing runtime errors when using `__experimental_resourceCache`.\n\n#### Actual behavior:\n\nApp throws an error:\n\n```\n[TypeError: Cannot read property '__internal_toSnapshot' of undefined]\n```\n\nThis happens as soon as `signIn.create(...)` is called, only when `__experimental_resourceCache` is present. When that prop is removed, everything works correctly.\n\n#### Reproduction in [clerk-expo-quickstart](https://github.com/clerk/clerk-expo-quickstart) \n\nhttps://github.com/user-attachments/assets/a9f9a723-eae2-43a7-8c65-870ed939d226\n\nOffline 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!\n\nThanks a lot for all the great work on this SDK!\n\n\n\n\n### Environment\n\n```Shell\nSystem:\n OS: macOS 15.4.1\n CPU: (8) arm64 Apple M1 Pro\n Memory: 128.27 MB / 32.00 GB\n Shell: 5.9 - /bin/zsh\nBinaries:\n Node: 22.14.0 - ~/.nvm/versions/node/v22.14.0/bin/node\n Yarn: 1.22.22 - ~/.nvm/versions/node/v22.14.0/bin/yarn\n npm: 10.9.2 - ~/.nvm/versions/node/v22.14.0/bin/npm\n pnpm: 10.9.0 - ~/.nvm/versions/node/v22.14.0/bin/pnpm\n Watchman: 2024.10.28.00 - /opt/homebrew/bin/watchman\nBrowsers:\n Chrome: 136.0.7103.114\n Safari: 18.4\nnpmPackages:\n @babel/core: ^7.26.10 => 7.26.10\n @clerk/clerk-expo: ^2.8.5 => 2.8.5\n @expo/vector-icons: ^14.0.4 => 14.0.4\n @react-native-community/cli-server-api: ^15.1.0 => 15.1.3\n @react-navigation/native: ^7.0.0 => 7.0.15\n @types/jest: ^29.5.14 => 29.5.14\n @types/react: ~18.3.12 => 18.3.18\n @types/react-test-renderer: 18.0.7 => 18.0.7\n expo: ^52.0.39 => 52.0.39\n expo-constants: ~17.0.8 => 17.0.8\n expo-font: ~13.0.4 => 13.0.4\n expo-linking: ~7.0.5 => 7.0.5\n expo-router: ~4.0.18 => 4.0.18\n expo-secure-store: ~14.0.1 => 14.0.1\n expo-splash-screen: ~0.29.22 => 0.29.22\n expo-status-bar: ~2.0.1 => 2.0.1\n expo-system-ui: ~4.0.8 => 4.0.8\n expo-web-browser: ~14.0.2 => 14.0.2\n jest: ^29.7.0 => 29.7.0\n jest-expo: ~52.0.6 => 52.0.6\n react: 18.3.1 => 18.3.1\n react-dom: 18.3.1 => 18.3.1\n react-native: 0.76.3 => 0.76.3\n react-native-gesture-handler: ~2.24.0 => 2.24.0\n react-native-reanimated: ~3.17.1 => 3.17.1\n react-native-safe-area-context: 4.12.0 => 4.12.0\n react-native-screens: ~4.9.2 => 4.9.2\n react-native-web: ~0.19.13 => 0.19.13\n react-test-renderer: 18.2.0 => 18.2.0\n typescript: ~5.8.2 => 5.8.2\n```","author":{"url":"https://github.com/dzmitryFesik","@type":"Person","name":"dzmitryFesik"},"datePublished":"2025-05-26T21:10:56Z","url":"https://github.com/clerk/javascript/issues/6010"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:3363eeb0-b5c1-90f4-df78-5f3c2bb520af |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B182:23725B:11F7643:1896B92:6AFB68DD |
| html-safe-nonce | 4a43b0325e602a2a7778b46eb343ba9b8787aa55c001582ac58e5136cc0f48db |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMTgyOjIzNzI1QjoxMUY3NjQzOjE4OTZCOTI6NkFGQjY4REQiLCJ2aXNpdG9yX2lkIjoiNzcwMjg2NTU5MDUxMDkwNTU2NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 875addca189097803a4005f652c52396b7caf0d1bee0fd3aa1128f864dd0879f |
| hovercard-subject-tag | issue:3092064586 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/clerk/javascript/6010/issue_layout |
| twitter:image | https://opengraph.githubassets.com/98c6444c85e6075d1f08a217059724abbfb8f76693e00c60d5ad3d69c4fb21d1/clerk/javascript/issues/6010 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/98c6444c85e6075d1f08a217059724abbfb8f76693e00c60d5ad3d69c4fb21d1/clerk/javascript/issues/6010 |
| og:image:alt | 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 ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dzmitryFesik |
| hostname | github.com |
| expected-hostname | github.com |
| None | ea33d13c96d0ff66bd8fa906b193d2213536b78cb06b0c50a4632c58b1418f94 |
| turbo-cache-control | no-preview |
| go-import | github.com/clerk/javascript git https://github.com/clerk/javascript.git |
| octolytics-dimension-user_id | 49538330 |
| octolytics-dimension-user_login | clerk |
| octolytics-dimension-repository_id | 438331492 |
| octolytics-dimension-repository_nwo | clerk/javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 438331492 |
| octolytics-dimension-repository_network_root_nwo | clerk/javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 59ef97164c52cf59bd10558ddec9c4f482763988 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width