AsyncStorage in Expo/Web cannot find "window"

101 Views Asked by At

Trying to reproduce the supabase/native example:

https://supabase.com/docs/guides/getting-started/tutorials/with-expo-react-native

when I start up an expo app in web mode I get the following error:

% npm run web

> [email protected] web
> expo start --web

...

› Web is waiting on http://localhost:8081

› Using Expo Go
› Press s │ switch to development build

.... › Press o │ open project code in your editor

› Press ? │ show all commands

Logs for your project will appear below. Press Ctrl+C to exit.
Server Bundling complete 5419ms (node_modules/expo-router/node/render.js)
Server Bundling complete 1748ms (node_modules/expo-router/node/render.js)
Web Bundling complete 5628ms (node_modules/expo-router/entry.js)
Web Bundling complete 1967ms (node_modules/expo-router/entry.js)
"shadow*" style props are deprecated. Use "boxShadow".
selectable prop is deprecated. Use styles.userSelect.
editable is deprecated. Use readOnly.
TouchableOpacity is deprecated. Please use Pressable.
accessibilityDisabled is deprecated.
accessibilityRole is deprecated. Use role.
focusable is deprecated.
ReferenceError: window is not defined
    at getValue (/Users/dave/Documents/repos/eatyourfriend/node_modules/@react-native-async-storage/async-storage/lib/commonjs/AsyncStorage.js:63:26)
    at /Users/dave/Documents/repos/eatyourfriend/node_modules/@react-native-async-storage/async-storage/lib/commonjs/AsyncStorage.js:39:21
0

There are 0 best solutions below