Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native Error: Unable to resolve module `./index`

Tags:

react-native

I have a newly created application using React Native. The app contains a simple login form and a fetch query, nothing complicated, few css and components.

I tried to implement Facebook, and after a LOOOT of struggle, I stopped receiving Facebook errors, while now, I get this error which makes no sense when I run react-native run-android :

No screen shown, nothing, diretcly this 500 error. I searched all over and over for a solution, I even added the form for Gradle, re-installed all npm packages after rm rf node_modules.. still the same error.

implementation ("com.facebook.react:react-native:0.58.5"){force = true}

enter image description here

like image 989
Chaibi Alaa Avatar asked Feb 25 '19 12:02

Chaibi Alaa


2 Answers

Used npm start -- --reset-cache to run Metro Bundler and it worked. Found this solution looking for the answer to the same issue, SO post that helped me.

like image 144
ilerik Avatar answered Nov 08 '22 00:11

ilerik


I think this question might be related to Unable to resolve module `./index` So the question is, did you try to run the app before you connected facebook? If it worked before then we might have a different issue. However, it's similar to this bug: https://github.com/facebook/react-native/issues/24112

A fix has been released a few hours ago. Please upgrade to react-native 0.59.2.

react-native upgrade

The full guide on how to upgrade: https://facebook.github.io/react-native/docs/upgrading

like image 4
THpubs Avatar answered Nov 08 '22 01:11

THpubs