-
Notifications
You must be signed in to change notification settings - Fork 35
jest-haste-map: @providesModule naming collision: Duplicate module name #172
Comments
The contents in the Jest is a unit test framework, it's not part of the awsmobile-cli. |
Thanks for your reply! I know that this used to be fine, as I've had no problems before, but since upgrading to react-native 0.56.0 this issue has started happening. Right now, I currently can't find how to exclude the On the topic of awsmobile, is there any reason my project needs awsmobile folders prepended by a '~'? Can these be deleted? |
awsmobile folders with name prefix '~' are backups, awsmobile-cli does not want you to loose your files, so if the cli is creating the contents in the awsmobilejs folder anew, it backs up the original contents in the backup folders. |
Hi @juang97, did this issue start being a problem after you had run a |
@UnleashedMind, if I delete Next time when I do an
and say yes to sync info, will I then get a new #current-backend-info folder created? I |
@C2P1. I was able to patch this issue by blacklisting the Table name under the awsmobile folder. This approach doesnt exactly fix the problem but everything is working as expected for me. If you are interested, take a look here https://stackoverflow.com/questions/41813211/how-to-make-react-native-packager-ignore-certain-directories |
I'm having this exact same problem. I was just about to post and ask a question about it... but it's here already. (node:90796) UnhandledPromiseRejectionWarning: Error: jest-haste-map: @providesModule naming collision: I've tried multiple solutions, but nothing... I can no longer compile my app. I've tried clearing the jest cache map on run, and nothing, tried removing react-native and reinstalling react-native and nothing, I also tried removing the entire node_modules folder and reinitialising, but nothing. |
As stated by @juang97 I followed the same procedure, and added the following to a file nammed rn-cli.config.js in the root of my project...
Works 100% fine since then. Thanks guys. |
…current-backend-info and backend, both under awsmobilejs. I followed along to the responses at this github link: amazon-archives/awsmobile-cli#172 and was able to resolve this issue by creating rn-cli.config.js and adding it to the root of my project. A copy of it can be found in the same folder as App.js
@michaelcuneo 's solution worked for me. Thanks :) |
Yup, I'm seeing the same thing @Ivanrs297. I'm trying to figure out how to block jest from peering into my iOS build area now... |
And so what I did was to rename the package.json -> package.json-off in the ios/Pods/React directory and it's good. If anyone knows how to tell jest-haste-map to ignore the iOS directory, that would be great to know. @Ivanrs297 |
it's good? |
react and react-native packages should be installed globally and not within any packages node_modules folder... or it’ll break it like this. |
My problem was AdMob plugin. |
@shinriyo if it doesn't work for you, maybe you have something else going on. |
@emlynmac thanks, it works but this is a temporary solution, we hope this can be fixed in newer versions |
@emlynmac I explained what I meant really poorly. I mean, if you have a project called Potato, with node_modules inside, it can have react-native in there... but if you have a project inside node_modules called 'potato_helper, which also houses it's own node_modules folder, and dependencies, but one of these dependencies is react-native, and is a different version to that of the global node_modules folder in the main package of Potato... issues can occur, and cause the declaration definition issues... at least that's what has caused issues for me in the past. |
@michaelcuneo Did anyone find the solution for this issue? |
I am having the same issue, not managed to a solution. |
hi i find the problem. two folder node_modules, example: node_modules and node_modules_test. |
@psalmdawg |
the fix rn-cli.config.js and changing the blacklist folder name to #current-cloud-backend worked for me.
|
I can confirm this works
|
For future reference, this solution worked for me |
@wilywork's reply worked perfectly for me, I made a backup of node_modules folder as node_modules_bkp. |
@abdul-elah-js do you mind share solution, link is not working, thanks |
@nara's solution worked well for me here:
When I did
|
Also if you are using typescript, I added the blacklist in |
just to iterate @jimji1005 said, if you are using typescript, put this in your
|
Creating a file const blacklist = require('metro').createBlacklist;
module.exports = {
resolver: {
blacklistRE: blacklist([/#current-cloud-backend\/.*/]),
},
}; |
I have tried this and I am still getting the same error. I am running the app on Android Studio. Any pointers? |
@RoniqueRicketts I only tested on iOS, sorry 🤷🏻♂️ |
@janhesters After creating the |
@RoniqueRicketts No you won't need to call it (at least I didn't). |
It’s not working for me. |
running the tests with the --silent option resolved the issue for me |
So what does the —silent flag do to the application?
|
Silent prevents tests from printing messages through the console. |
@roychoo Works like a charm. Thank you! |
So for React Native 0.61 without Expo (run with "npx react-native run-android"), changing the existing metro.config.js (not rl-cli.config.js) seems to work
|
Hello,
Trying to run npm start on my project is now giving me the following error:
both of these package.json are identical and have the field:
"name": "app"
I am now currently unable to build and run my app due to this.
Whenever I use the command
awsmobile pull
I enter Yes to the questionand it to me it appears like this is where the issue is created. Should I not be syncing the contents? How do I fix this so I can build my project?
Thanks!
The text was updated successfully, but these errors were encountered: