I'm using a React Native project with Expo v49, and I added a Supabase call to read some data from the database, and it works on ios/android,
But when I open the web version, I get "ReferenceError: window is not defined", and it shows the error is somewhere in the expo-router package
Any help would be appreciated
Tldr: I added the supabase-js call in a useEffect hook of my component (to fetch the backend data), and it works on mobile, but not on React Native Web.
To prevent this behavior, set output in your app.json from "output": "static", to "output": "single",.
Had the same problem using react-native, expo, and supabase and this change fixed it for me.
Source: helpful reddit post
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With