Open
Description
Bug report
- I confirm this is a bug with Supabase, not with my own application.
- I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
When using @supabase/supabase-js
in an expo react native project, if I use the unstable_enablePackageExports
with the metro bundler, bundling fails with the following error:
To Reproduce
- Generate a new expo app
- Add
@supabase/supabase-js
as a dependency - Create a supabase client in the main
_layout.tsx
file - Run
npx expo customize metro.config.js
- Add
config.resolver.unstable_enablePackageExports = true;
tometro.config.js
- Add
ios.bundleIdentifier
toapp.json
- Run
npx expo run:ios
Repro repo: https://github.com/aldebout/supabase-expo-exports-issue
Expected behavior
No crash
Screenshots

System information
- OS: macOS
- Version of supabase-js: 2.45.1
- Version of Node.js: 20.16.0
Additional information
Opening here because the error message I got in my actual project was
The package at "../../node_modules/@supabase/realtime-js/node_modules/ws/lib/stream.js" attempted to import the Node standard library module "stream".
It failed because the native React runtime does not include the Node standard library.