-
Notifications
You must be signed in to change notification settings - Fork 467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jest-haste-map: Haste module naming collision: react-native #169
Comments
Hi @sibelius , Can you provide some info about your monorepo setup? Using |
Throwing the same error to me:
Then this in Android Studio:
These errors are driving me insane. I've been struggling to make my app work in Android for an entire week already. Using |
|
This is causing me issues too 0.60.4 RN |
same issue for me but with expo/metro. node: v10.16.0
|
this is out nohoist setup "workspaces": {
"packages": [
"packages/*"
],
"nohoist": [
"**/eslint",
"**/react",
"**/react*",
"**/react-native",
"**/react-native-*",
"**/@react-native-community",
"**/@react-native-community/cli",
"**/@react-native-community/cli-platform-ios",
"**/@react-native-community/cli-platform-android",
"**/@react-native-firebase/app/",
"**/@react-native-firebase/**",
"**/victory**",
"**/@sentry",
"**/@sentry/cli",
"**/@sentry/wizard",
"@sentry",
"@sentry/cli",
"@sentry/wizard"
]
} it is breaking for cameraroll as well |
why jest is causing trouble with react-native packager? |
@sibelius because Metro uses Haste, which lives in |
the closest one for our setup is this one https://github.com/entria/entria-fullstack/tree/master/packages/app |
can we remove haste from this package instead? |
It's not about this package, it's about |
Im just trying to create an empty app for learning purposes. There is no way around to fix this and keep learning? `Loading dependency graph...jest-haste-map: Haste module naming collision: HelloWorld Failed to construct transformer: { Error: Duplicated files or mocks. Please check the console for more info using node --version iMac pro Xcode 10.2.1 |
just changed package.json in templates folder and know it works... at least for testing purposes it's working |
#重复 I add the modules but get the same issue when i start the app |
@yuanmaole Try following points from our troubleshooting doc |
I had the same problem and I solved it for myself. Since I have reproduced it again and again it gives me the thought that it might be the problem to you all as well. My problem is that I had App2 project directory under (inside) App1 project directory (both created using react-native init <App_>). Once I have removed App2 from App1 directory it all worked fine. I got it by the indication I got (and you also mentioned it) on
|
My workaround was rename your project folder and if you use amplify be careful with in metro.config.js |
I was having the same issue, I have created a backup folder called |
Same issue, it was because I was importing package.json inside the app. Look for something like |
Do you have any solution? |
In my case I followed "React Native Modules setup" instruction from official website for get this error. And the error says, that here are 2 same package.json, first in "node_modules/react-native" and second in "node_modules/[cusom-module]/node_modules/react-native". So, I deleted "node_modules" from my [custom-module], after that I made this in my app root folder: After that my app runs without any problem. |
This error comes from the fact that there are, indeed, two packages with the same name - they live in different packages' New Async Storage is a monorepo, with few packages and example project that has dealt with that issue - check out the |
if you have this works for me |
@thymikee Appreciate you mentioning this, resorted to |
|
Still no solution for it. :( |
Let's hope the release of RN |
issue is still in v0.61.1
|
In my case this is happening with any .json file being imported. Finally located the problem as follows. _ Hope this helps |
I came here from another similar issue of package: I just removed folder: Now app runs fine, but how it will work not sure. this repo using "react-native": "0.58.4" |
I was also facing the same issue and tried what you suggested but react-native-twitter-signin on building crashes with
kindly please suggest solutions |
This worked for me also. I examined a project I made a few weeks ago which didn't have the template directory compared to one I made today that has it. So deleting this template stuff seems to be due to a a recent change in the init project script possibly? |
@RonakCPereira Finally i found another package. It's just fork of same repository without dependencies. So i just changed package.json and no more. |
see @krizzu reply #169 (comment) |
facebook/metro@f3c9862 Temporary solution but worked for me. I've had this problem while building for ios. Solution (for ios building problems):
I have got this solution from hunwalk from this issue Hope this helps... Cheers |
@guitorioadar Well, this happened with me after running the ios release build. Great catch!! |
i clean all build like that:
and just use
then it's ok. |
fixed upgrading to react-native 61 no more haste issues \o/ |
Hey in my case it was because of a previous nodejs app some how made its way into my current project. check and see if you don't have two apps in the same folder |
Node Module -> react-native-twitter-signin -> node module This is work for me |
npm install --save GoldenOwlAsia/react-native-twitter-signin#master |
This happened to me when I was trying to use a package that specified an exact version of react native in its package.json:
It did not match the version I was using at the time (0.60.6) and so
|
you saved my life, really this issue drive me crazy and your solution work for me, thanks |
In my case was parsing JSON inside a package.json. I put a package.json file inside my folders that I access frequently, so I can import them just by calling the name, like this: Probably I pressed on key unintentionally while the package.json file was open! clean package.json up fixed my problem. None of the above-mentioned solutions fixed my issue. If none of the solutions worked for you try to think what was the last thing you did before it broke down. |
In my case it was a fresh React Native project initiated using the TypeScript template as shown in a reactnative.dev tutorial. I deleted the |
This solution worked for me as well |
@edgarclerigo |
for those who use AWS Amplify and having duplicated file error from jest-haste-map you can ignore the package.json file inside the #current-cloud-backend folder by adding below code inside metro.config.js file:
|
In case you're using Typescript, don't make the mistake to rename |
Works prefectly Feb 2021! Thank you! |
Hi sorry for the stupid question, but I'm already two days into trying to get this to work but where exactly is the metro.config.js file? I also tried adding one to the root as instructed in some other fix but it didn't seem to work. . |
Ive tried everything until i saw that ive change my node_modules to _node_modules and for some reason it was bundeled and create the duplicate error |
For me it was showing So I deleted the mockPath1 and it worked |
Current behavior
Expected behavior
It should not duplicate haste
Repro steps
"react-native": "0.60.4",
"@react-native-community/async-storage": "1.5.1",
on a monorepo setup
Install
Environment
The text was updated successfully, but these errors were encountered: