Cannot find module 'react-native/Libraries/LogBox/LogBox' from 'setup.js'

General info:

  1. SDK Version: sdk-37.0.1
  2. Platforms: all

Error:
Cannot find module ‘react-native/Libraries/LogBox/LogBox’ from ‘setup.js’
at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:299:11)
at Object. (node_modules/jest-expo/src/preset/setup.js:155:6)

My package.json:

[dependency]

“react-native”: “https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz

[dev dependency]
“jest-expo”: “^39.0.0”,
“react-test-renderer”: “^16.13.1”

You can check from this repo’s branch: https://github.com/apappas1129/firestore-chat/tree/jesting

1 Like

I’m facing the same issue.

Have posted this on stackoverflow: https://stackoverflow.com/questions/64096970/jest-testcase-breaking-in-react-native-expo

Hey @apappas1129,

It looks like you’re using jest-expo v39 with a project running SDK37. LogBox was released with React Native 0.63 which is what SDK39 is using. Can you try running with v37.0.0 and see if that resolves the issue?

Cheers,
Adam

Thank you. What I did instead was upgrade my Expo SDK from 37 to 39 with a simple expo upgrade. I thought there would be breaking changes that I had to deal with as mentioned in the documentation about upgrading expo. But it all went smoothly coming from 37.