Open aldebout opened 3 months ago
Is there any update on this? I've run into the same issue
I've also run into this when trying to use Storybook and Expo.
I'm able to run it by manually specifying nodeModulesPaths
and setting disableHierarchicalLookup
to true
(in a monorepo setup).
I'm able to run it by manually specifying nodeModulesPaths and setting disableHierarchicalLookup to true (in a monorepo setup).
This solution didn't work for me
I was able to fix it by patching @supabase/realtime-js to match supabase/realtime-js#426
patchfile looks like this
diff --git a/dist/module/RealtimeClient.js b/dist/module/RealtimeClient.js
index a8bb0121343481d789acb0248ecbb20c7e4597fe..a299d5b3370b836bdf28307deb7a157c6ccf0bc5 100644
--- a/dist/module/RealtimeClient.js
+++ b/dist/module/RealtimeClient.js
@@ -143,12 +143,6 @@ export default class RealtimeClient {
this.conn = null;
},
});
- import('ws').then(({ default: WS }) => {
- this.conn = new WS(this._endPointURL(), undefined, {
- headers: this.headers,
- });
- this.setupConnection();
- });
}
/**
* Disconnects the socket.
named patches/@supabase__realtime-js.patch
I then added the following to my package.json (for pnpm)
"pnpm": {
"patchedDependencies": {
"@supabase/realtime-js": "patches/@supabase__realtime-js.patch"
},
"overrides": {
"@supabase/realtime-js>ws": "-"
}
}
Cross-posting https://github.com/supabase/realtime-js/issues/415 because I'm not sure you're monitoring the issues on the other repo :)
Bug report
Describe the bug
When using
@supabase/supabase-js
in an expo react native project, if I use theunstable_enablePackageExports
with the metro bundler, bundling fails with the following error:To Reproduce
@supabase/supabase-js
as a dependency_layout.tsx
filenpx expo customize metro.config.js
config.resolver.unstable_enablePackageExports = true;
tometro.config.js
ios.bundleIdentifier
toapp.json
npx expo run:ios
Repro repo: https://github.com/aldebout/supabase-expo-exports-issue
Expected behavior
No crash
Screenshots
System information
Additional information
Opening here because the error message I got in my actual project was