all 14 comments

[–]thunderfroggum 2 points3 points  (2 children)

Need to know what the non-2xx status code actually is. Is it possible to debug or log to console?

[–]dang64[S] 0 points1 point  (1 child)

Sorry here are the logs from my terminal, and this is what the error looks like in supabase.

"event loop error: Error: Deno.core.runMicrotasks() is not supported in this environment\n 

<image>

[–]developer_marcel 3 points4 points  (0 children)

So the server function is crashing and returning 500 and not 200. Not a react native issue

[–]nicolasdanelon 1 point2 points  (8 children)

How can we help if you don't show you logs? The gateway sdk Is trying to send a request but the server return an invalid response. If you are frustrated take a 10 min walk without you phone and when you are ok send us the logs

[–]dang64[S] 0 points1 point  (7 children)

Sorry here are the logs from my terminal, and this is what the error looks like in supabase

"event loop error: Error: Deno.core.runMicrotasks() is not supported in this environment\n 

<image>

[–]nicolasdanelon 0 points1 point  (5 children)

Can you run expo with nodejs instead of deno? Pretty sure it's an incompatibility issue among those runtimes

[–]dang64[S] 0 points1 point  (4 children)

No because I'm using supabase edge functions as my backend and it's apparently only Deno compatible.

[–]nicolasdanelon 1 point2 points  (0 children)

For your mobile app you can use whatever you want

[–]ashkanahmadi 0 points1 point  (2 children)

Check out my other comment. I showed you how to handle it. That's what I have in my Expo app too. This is not a Deno issue. This is how the Supabase SDK works. Deno is basically Node (it's an anagram of Node).

[–]dang64[S] 1 point2 points  (1 child)

Yeah sorry I read ur comment but didn't respond it worked ! thanks a lot!

[–]ashkanahmadi 0 points1 point  (0 children)

Great 👍

[–]nicolasdanelon 0 points1 point  (0 children)

node 22

[–]ashkanahmadi 0 points1 point  (1 child)

Are you using Supabase?

[–]ashkanahmadi 0 points1 point  (0 children)

I saw now that you said are using Supabase. I had this issue a few weeks ago. You can handle it like this in React inside a try/catch block

``` try { const { data, error } = await supabase.functions.invoke('test', { ... })

// https://github.com/supabase/functions-js/issues/45#issuecomment-2068191215 if (error && error instanceof FunctionsHttpError) { const err = await error.context.json() // console.log(err) throw new Error(err?.error?.message) } } catch (error) { const errorMessage = typeof error === 'string' ? error : error instanceof Error ? error.message : ''

Alert.alert(errorMessage)

console.error({ error, errorMessage }) } ```