__fbBatchedBridgeConfig is not set, cannot invoke native modules

Hi,
I’ve tried to create expo app following official guide: https://docs.expo.io/versions/latest/guides/running-in-the-browser
But when I run “expo start --web” I Get error on page: __fbBatchedBridgeConfig is not set, cannot invoke native modules

How can I fix it?

1 Like

Please ensure you are running in a version of Expo that supports web (SDK 33+) and you have react-native-web, react-dom installed. Also update your expo-cli version.

1 Like

Hi everyone,

I have the same issue as @chirov3. It is a simple repro:

  1. run npx create-react-native-app test-expo-web
  2. choose the expo-template-blank template (also tried the tabs template and got the same result)
  3. run expo run --web
  4. see error on browser

I’m running npm on 6.13.6 and expo-cli on 3.17.24.

P.S.: The expo-cli console prints the following warnings, but they seem unrelated to the actual __fbBatchedBridgeConfig error:

Compiled with warnings.
./node_modules/expo/build/logs/LogSerialization.js
Attempted import error: 'react-native/Libraries/Core/Devtools/symbolicateStackTrace' does not contain a default export (imported as 'symbolicateStackTrace').

./node_modules/react-native/Libraries/Performance/Systrace.js
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

To give a bit of context on how I ran into this error, I have a mature expo managed project (started on SDK 31) that is currently running SDK 36 perfectly on both android and ios. Product lifecycle now claims for a web version and while following the setup to integrate the web platform to our expo.platforms array on app.json was seamless (thanks to the great docs! :heart:), I got this when I tried to compile with expo start --web:

Failed to compile.
./node_modules/react-native/Libraries/Components/TextInput/TextInputState.js
Module not found: Cannot resolve '../../Utilities/Platform' in './node_modules/react-native/Libraries/Components/TextInput'

Looking into node_modules/react_native folder, I saw that indeed the node_modules/react-native/Libraries/Utilities/Platform.js doesn’t exist, but it has Platform.android.js and Platform.ios.js.

So that’s when I tried to spin up a brand new CRNA managed project hoping to see what those node_modules/react-native files looked like on a web build that could successfully compile so I maybe could figure out which react-native/platform file to use (fixed with patch-package or something else), but ended up having this other __fbBatchedBridgeConfig issue… :slightly_frowning_face:

All help and/or insight into any of these issues would be greatly appreciated. Thanks in advance!

Update to my situation on this issue:

Instead of using CRNA, I tried expo init and it compiles successfully to web in both blank and tab templates. It is interesting though that the TextInput files are exactly the same, where TextInputState.js imports Platform from '../../Utilities/Platform'and that file doesn’t exist.

What’s more is that the second I add a single <TextInput /> component to these working expo init projects and run again with expo start --web, the __fbBatchedBridgeConfig is not set error gets thrown again.

Do you know if react-native core modules such as TextInput and AsyncStorage are supported by expo web compilation @bacon?