Skip to content

Conversation

@alextoudic
Copy link
Contributor

Fixes the TypeError: Cannot read property 'Base64' of undefined error on Expo SDK 54, caused by expo-file-system/next becoming the default export and the old API moving to expo-file-system/legacy (see #3583).

This update adds a conditional import that uses expo-file-system/legacy when available (Expo SDK 54) and falls back to the default import otherwise. This keeps the polyfill working across both older and newer Expo releases.

Note:
It uses a try / catch approach as requiring expo-file-system/legacy on former versions of Expo will raise a Unable to resolve "expo-file-system/legacy" from "node_modules/@react-three/fiber/native/dist/react-three-fiber-native.cjs.prod.js" error

@alextoudic alextoudic changed the title fix(polyfills): conditionally import expo-file-system/legacy to suppo… Fix Expo SDK 54 compatibility through workaround Nov 14, 2025
@CodyJasonBennett CodyJasonBennett changed the title Fix Expo SDK 54 compatibility through workaround fix: Expo SDK 54 compatibility through workaround Nov 29, 2025
@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 52af270:

Sandbox Source
example Configuration

@CodyJasonBennett CodyJasonBennett merged commit b19f059 into pmndrs:master Nov 29, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(React Native): Loaders fails with "Cannot read property 'Base64' of undefined" (repro included)

2 participants