supabase: URL.hostname is not implemented
Bug report
Describe the bug
Just upgraded to supabase v2.0.0-rc.1 and getting a URL.hostname is not implemented error.
This is a React Native/Expo app.
To Reproduce
Do the following in an expo app:
export const supabase = createClient<Database>(SUPABASE_URL, SUPABASE_ANON_KEY, {
auth: {
persistSession: true,
autoRefreshToken: true,
detectSessionInUrl: true,
},
})
Screenshot
Additional context
Never had problems in v1, so this is related to the latest update.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 16 (3 by maintainers)
error disappeared after importing this polyfill in the same file where I was importing the client:
Hello! I just got this error as well and I do not understand why this was closed @monicakh; The solution by @vbylen is more a workaround than anything else
I can confirm the issue still exists with supabase 2.4.0, react 18.1.0 and react-native 0.70.5.
The workaround works, but I guess a fix is still needed.
You’re right @ski043 @ildaneta @Garabed96, the docs needed to be updated. Ideally for RN
supabase-jswouldn’t need to depend onhostname()(or have its own implementation), but in the mean timereact-native-url-polyfill/autois the best solution.Docs have been updated as of https://github.com/supabase/supabase/pull/14207, thank you again @faizanraso.
May 2023, this is still an issue. “@supabase/supabase-js”: “^2.21.0” “expo”: “~48.0.11” “react-native”: “0.71.7”
import ‘react-native-url-polyfill/auto’ fixed it as @vbylen said but why close it without adding it to the documentation in: https://supabase.com/docs/guides/getting-started/tutorials/with-expo
@vbylen Should we close this issue ?
Tks https://github.com/supabase/supabase/issues/8464#issuecomment-1221448428
I’m here to confirm that this error is still happening.
Installing react-native-url-polyfill works, but a fix is necessary, or maybe update the documentation to explain better about it.
Both Android and iOS:
Any resolutions to this error? I’m still getting this.
Same problem led me this way. Should definitely be mentioned in the quick start guide!