https://supabase.com/ logo
any ideas why ` let {data, error} = await supabas...
# help
g
any ideas why
let {data, error} = await supabase.from('food').select('*');
might just "fail" with a
Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.
warning? Inspecting the network shows it's not even making a call to the api. I have calls to superbase.auth.signUp working fime...
Copy code
js
  let {user, error} = await supabase.auth.signUp({
    email: email,
    password: password,
  });
i'm not quite sure what i'm doing wrong here...
n
Hello @gorbypark! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User so that they can see your message and help you as soon as possible! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ``...`` menu) and select "Leave Thread" to unsubscribe from future updates. Want to change the title? Use the ``/title`` command! We have solved your problem? Click the button below to archive it.
g
oh my gosh, it was because I'm using react-native and needed to add a url polyfill...
s
One thing that might be worth adding is
detectSessionInUrl: false
in your
createClient
function. Make sure you add
import AsyncStorage from "@react-native-async-storage/async-storage";
and then set
localStorage: AsyncStorage as any,
in
createClient
too. Require cycles usually indicate that you have a file importing another file, which is then importing the first file. Sometimes that's like
a -> b -> a
, other times it's a longer loop like
a -> b -> c -> d -> a
. I've found it doesn't usually cause many problems, but always worth seeing if you can refactor to remove the warning
There's a good overview of doing it with Expo (also works with other RN frameworks) here: https://supabase.com/docs/guides/with-expo
g
yeah i should have looked at that, i just kinda forged ahead without reading much of anything 😛
thanks for the tips!
2 Views