"The module does not exist in the module map or in these directories" in

I began to study the reaction to my native language. I am struggling in a simple reactive native project when importing new js [example Home.js] in index.android.js I get the following error:

The module does not exist in the module map or in these directories.

UnableToResolveError: Unable to resolve module .src/Components/home/Home/Home.js

from C:\Users\Magi\Dictionary1\index.android.js

: module does not exist in the module map or in these directories:

import React, { Component } from 'react';    
import {
  AppRegistry,
  StyleSheet,
  Text,
  View
} from 'react-native';    
import Home from '.src/Components/home/Home/Home.js';

      

+3


source to share


2 answers


If Home.js

u index.android.js

are in the same directory, you can replace

import Home from '.src/Components/home/Home/Home.js';

      

from



import Home from './Home.js';

      

But if your folder src

is at the same level as index.android.js

, the .

front .

should be src

:

import Home from './src/Components/home/Home/Home.js';

      

+1


source


Some unwanted imports may cause the problem.

For me, this state was creating a problem.



import { exec } from "child_process";

      

+1


source







All Articles