问题
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
回答1:
Simply follow again below steps
yarn add react-native-tweet-view
react-native link react-native-tweet-view
回答2:
check the top of your file so that you have not imported
import { threadId } from 'worker_threads';
I removed that and it worked
回答3:
There is 3 issue in your import :
- You must not write the extension of the module you're importing
- Your file is named "Tweet.style" and you try to import "Tweet.styles"
- You have to import the relative path of your module
Correct import should be :
import styles from './Tweet.style'
回答4:
Some time this error happens because of malformed JS styles .. like
backgroundColor= '#fff'
instead of
backgroundColor: '#fff'
this ..
来源:https://stackoverflow.com/questions/50844133/unable-to-resolve-module-does-not-exist-in-the-haste-module-map