0

I'm asking again because my case wasn't solved on previous answers. I created a React Native App that works perfectly on Snack, but then I wanted to try it on Expo(I want to add some modules that Snack can't load). So, I used create-react-native-app to make my project. Then, after editing the code, I tried to launch it using the Genymotion emulator, but everytime I do it, the below error occurs : enter image description here

I can't understand what's wrong with it? I already tried removing node_modules folder, changing React Native and Babel version and reinstalling the project with npm install. Also, in console, it shows me this error:

22:33:56: Unable to resolve ./components/AssetExample" from "./C:\\Users\\danie\\HC\\App.js`: The module `./components/AssetExample` could not be found"
22:33:56: Failed building JavaScript bundle

but I don't know where should this module be imported? package.json or package-lock.json?

I launch it in Genymotion using the following:

cd HC
npm start android

What can I do? Please help me.

React Native version: 0.55.2

Babel(preset React Native) version: ^4.0.0

Edit: Project Structure & code as requested, I created the repository on GitHub: https://github.com/DanielVip3/HC ^ I didn't push the node_modules folder because it was too large, but I think you already know: it contains all the modules that React Native uses.

DanielVip3
  • 179
  • 1
  • 2
  • 12
  • You’ll likely get more response if you add the smallest version of your code that shows this behaviour to the question; without it there isn’t much to work with. – msbit Sep 21 '18 at 22:17

2 Answers2

0

The application is looking for ./components/AssetExample in your own application folder.

Gamma Ko
  • 442
  • 6
  • 10
0
Please give us your project structure and the code in App.js file (also make sure you export AssetExample class in AssetExample.js file.
What i understand you are trying to do is (probably) that in App.js you import AssetExample from "./components/AssetExample", so possible errors are:
1) path is wrong
2) you don't export default AssetExample in AssetExample.js 
angelos_lex
  • 1,593
  • 16
  • 24
  • just edited my code to add the project structure and the code. Anyway, I already thought that, but no, I'm not importing manually ./components/AssetExample, I think that a module that I have tries to import it. – DanielVip3 Sep 22 '18 at 17:10
  • Hmm, maybe then try: npm start --reset-cache , if i relate it to [this](https://stackoverflow.com/questions/40985027/unable-to-resolve-module-in-react-native-app) – angelos_lex Sep 24 '18 at 05:55