Failed building JavaScript bundle(Unable to resolve "./internal/defaultConfiguration")

Hi there,

I am new to Expo and having an issue I cannot resolve.

I’ve done some research and tried several fixes but none have worked(deleted node_modules folder, package-lock.json, updated expo to the latest version, tried expo start -c) but nothing has solved it.

The error I get is the following:

Unable to resolve “./internal/defaultConfiguration” from "node_modules@react-native-community\netinfo\src\index.ts"

I had the latest version of netinfo(5.7.0) and downgraded to “@react-native-community/netinfo”: “^4.6.0” as I was getting a different error. Once I did, I got this error and no matter what I did, it did not change.

Here’s a screenshot of the error on the mobile device I use to test the app:

Expo CLI 3.18.4 environment info:
System:
OS: Windows 10 10.0.18362
Binaries:
Node: 12.16.1 - C:\Program Files\nodejs\node.EXE
npm: 6.13.4 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 3.6.0.0 AI-192.7142.36.36.6308749
npmPackages:
expo: ~36.0.0 => 36.0.2
react: ~16.9.0 => 16.9.0
react-native: https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz => 0.61.4
react-navigation: ^4.3.7 => 4.3.7

Thank you in advance!

did you install it with expo install @react-native-community/netinfo? https://docs.expo.io/versions/latest/sdk/netinfo/

i suspect no because i can see that you are using "^4.6.0" but the version should be “4.6.0” which is potentially an important distinction (learn more about semver at https://semver.npmjs.com/.

that may not be the source of the error though. if you google that error you will find https://github.com/facebook/react-native/issues/6035. you may want to try disabling remote js debugging and closing your debugger.

Initially I did install it with expo install @react-native-community/netinfo , I then edited the package.json file, simply changed the version of netinfo fro 5.7.0 to 4.6.0 and ran npm install.

When I run npm list @react-native-community/netinfo I get “-- @react-native-community/netinfo@4.6.0”

I double checked to make sure I am not missing any dependencies, closed the debugger, nothing changed, I get the same error on my device(Android) and on Android Studio emulator.

The only thing I have not tried is to start over with a fresh project, I would very much want to avoid that but if I have no other choice, then I guess I will.

Initially I did install it with expo install @react-native-community/netinfo , I then edited the package.json file, simply changed the version of netinfo fro 5.7.0 to 4.6.0 and ran npm install.

i’m not sure how you ended up with 5.7.0 if you are using sdk36. sdk37 does not use that version (https://github.com/expo/expo/blob/0f7e4ff3dcdbd4600d8e976f5654d0b96dd0e61c/packages/expo/bundledNativeModules.json#L3) and sdk 36 uses 4.6.0.

interesting that you did indeed have the debugger open. you can open the development menu in the app by dismissing that red screen error and shaking your device or pressing the menu button, then disable debugging js from there

I am currently learning web development, I honestly do not know either how I ended up with version 5.7.0 . The course content stated “run expo install @react-native-community/netinfo” and I did, that was the result.
Thank you for taking the time to explain, very helpful!

The main issue was what you pointed out initially, I was using “^4.6.0” and not “4.6.0”.
Thank you @notbrent !!!

For referrence: I had the same issue (and also some others) after trying to manually upgrade some packages. Using expo upgrade to get to sdk37 with correct dependencies solved all such issues for me.

1 Like

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