Expo 40 @RN/AsyncStorage: NativeModule: AsyncStorage is null

Please provide the following:

  1. SDK Version: 40
  2. Platforms(Android/iOS/web/all): Android/iOS

I have just upgraded my SDK from 39 to 40 by following to instructions from announcement blog by running the expo upgrade

The upgrade went well. But now when I start the app with expo start (running in physical device iOS 13, with latest Expo Client downloaded from app store), I get the exception screen:

This occurred immediately after upgrading. It was working fine with SDK 39.
It is worth noting that previously I was using @react-native-community/async-storage (which is also failing with same error after upgrade). Then I headed to the expo async-storage docs page where is now recommended to use @react-native-async-storage/async-storage

expo install @react-native-async-storage/async-storage

This is also failing

1 Like

I am in the exact same situation, help needed!

Similar issue. I tried clearing the cache and reinstalling packages.

I had the same problem with sentry-expo but I finally found the cause of this!

The problem was my metro.config.js. Be sure to follow instructions here: Customizing Metro - Expo Documentation

I had a custom resolver.sourceExts, without extending ...defaultConfig.resolver.sourceExts so *.expo.js files were not resolved.

Hope this helps, good luck!

1 Like

Hey! Thank you so much! It’s great to find this after 7 hours of debugging. This works on me (I’m using expo-yarn-workspaces too, so I just extend with both config)

1 Like

Hi Alex, are you able to share your metro.config.js file? We are facing the same issue.

This is our metro.config.js. It allows us to resolve *.properties files.

const { getDefaultConfig } = require('@expo/metro-config');

const defaultConfig = getDefaultConfig(__dirname);

module.exports = {
  resolver: {
    sourceExts: [...defaultConfig.resolver.sourceExts, 'properties'],
  },
  transformer: {
    babelTransformerPath: require.resolve('./babel-transformer.js'),
  },
};

Thank you very much for the swift response… our build broke when going from cli version 3.28.5 to version 4.1.6.

The metro.config.js file changed slightly and your sample made it easy to see how to fix. Really appreciate.

Andy.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.