react-navigation-drawer gives Unable to resolve module 'module://fbjs/lib/invariant.js' error

I get the error

Unable to resolve module ‘module://fbjs/lib/invariant.js’
Evaluating module://fbjs/lib/invariant.js
Evaluating module://react-native-reanimated.js
Evaluating module://react-navigation-drawer.js
Evaluating module://App.js.js
Loading module://App.js

whenever I add react-navigation-drawer to a snack. I created a new snack and added the import at

One suggestion was to add fbjs as a dependency which I tried with the following code and it did not help.

“dependencies”: {
“fbjs”: “latest”,
“react-navigation”: “4.1.1”,
“react-native-paper”: “3.6.0”,
“react-native-screens”: “^2.0.0”,
“react-native-reanimated”: “1.0.0”,
“react-navigation-drawer”: “latest”

I had the same error but only with Snack.
So, I updated my app with last package fbjs 1.0.0 and that works.
You can see my package.json :
“dependencies”: {
“expo-font”: “~8.0.0”,
“expo-web-browser”: “~8.0.0”,
“react-native-screens”: “2.0.0-alpha.12”,
@react-navigation/web”: “~1.0.0-alpha.9”,
@react-navigation/stack”: “^5.0.0”,
“react-native-reanimated”: “^1.7.1”,
@react-navigation/drawer”: “^5.3.4”,
@react-navigation/native”: “^5.0.0”,
@react-navigation/bottom-tabs”: “^5.0.0”,
“react-native-safe-area-context”: “0.6.0”,
@react-native-community/masked-view”: “0.1.5”,
"fbjs": “^1.0.0”,
“drawer”: “0.0.2”,
“react-navigation”: “^4.3.4”,
“react-navigation-drawer”: “^2.4.7”,
“react-navigation-stack”: “^2.3.7”
Also, I updated my package-lock.json.

So did the package.json you gave me fix the issue on snack? If so, how do you update package-lock.json on snack? I don’t see the file listed.

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