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: GitHub - apappas1129/firestore-chat at jesting

1 Like

I’m facing the same issue.

Have posted this on stackoverflow: javascript - Jest testcase breaking in React Native Expo - Stack Overflow

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.

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