Unable to resolve module…does not exist in the haste module map

北城余情 提交于 2019-12-10 17:39:04


I am a beginner on ReactNative, I am creating a Twitter clone to practice.

I had already developed a first application and I had no problem.

But since I started the new project, after adding custom modules in the project I have this error message.

In this case I want to import a style sheet into my custom Tweet component, I added a capture, it's better for you.

Screenshot - error message

So, I followed all the instructions of the capture, except Watchmen because I'm working on Windows 10, after doing the procedure, I recreated a new project with "react-create-app", restart XDE expo and the application but the problem comes back ...

I also tried the Github procedure dealing with the problem (see the catch for the issue) here => https://github.com/facebook/react-native/issues/4968


Simply follow again below steps

yarn add react-native-tweet-view
react-native link react-native-tweet-view


check the top of your file so that you have not imported

import { threadId } from 'worker_threads';

I removed that and it worked


There is 3 issue in your import :

  1. You must not write the extension of the module you're importing
  2. Your file is named "Tweet.style" and you try to import "Tweet.styles"
  3. You have to import the relative path of your module

Correct import should be :

import styles from './Tweet.style'


Some time this error happens because of malformed JS styles .. like

backgroundColor= '#fff'

instead of backgroundColor: '#fff' this ..