awsmobile-cli icon indicating copy to clipboard operation
awsmobile-cli copied to clipboard

Error: jest-haste-map: Haste module naming collision:

Open psalmdawg opened this issue 6 years ago • 6 comments

This error is caused by hasteImpl returning the same name for different files

I know this has been looked at before, but I just cannot get a fix working and its stopping me from proceeding using AWS. has anyone had this problem and found a work around solution?

Loading dependency graph...(node:55309) UnhandledPromiseRejectionWarning: Error: jest-haste-map: Haste module naming collision: Duplicate module name: pulseTrailFunction Paths: /Users/Pauly/Documents/webs2.0/projects/pulse/pulse_v3/amplify/backend/function/pulseTrailFunction/src/package.json collides with /Users/Pauly/Documents/webs2.0/projects/pulse/pulse_v3/amplify/#current-cloud-backend/function/pulseTrailFunction/src/package.json

This error is caused by hasteImpl returning the same name for different files. at setModule (/Users/Pauly/Documents/webs2.0/projects/pulse/pulse_v3/node_modules/metro/node_modules/jest-haste-map/build/index.js:551:17) at workerReply (/Users/Pauly/Documents/webs2.0/projects/pulse/pulse_v3/node_modules/metro/node_modules/jest-haste-map/build/index.js:613:9) at process._tickCallback (internal/process/next_tick.js:68:7) (node:55309) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2) (node:55309) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. (node:55309) UnhandledPromiseRejectionWarning: Error: jest-haste-map: Haste module naming collision: Duplicate module name: pulseTrailFunction Paths: /Users/Pauly/Documents/webs2.0/projects/pulse/pulse_v3/amplify/backend/function/pulseTrailFunction/src/package.json collides with /Users/Pauly/Documents/webs2.0/projects/pulse/pulse_v3/amplify/#current-cloud-backend/function/pulseTrailFunction/src/package.json

This error is caused by hasteImpl returning the same name for different files. at setModule (/Users/Pauly/Documents/webs2.0/projects/pulse/pulse_v3/node_modules/metro/node_modules/jest-haste-map/build/index.js:551:17) at workerReply (/Users/Pauly/Documents/webs2.0/projects/pulse/pulse_v3/node_modules/metro/node_modules/jest-haste-map/build/index.js:613:9) at process._tickCallback (internal/process/next_tick.js:68:7) (node:55309) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)

psalmdawg avatar Dec 01 '18 20:12 psalmdawg

Same issue here. Do you have an update?

torigeorge avatar Dec 14 '18 14:12 torigeorge

Did you try to use the solution by nara posted in #172?

UnleashedMind avatar Jan 19 '19 01:01 UnleashedMind

i was facing this issue because i instaall package image slider having react-native in it try to unlink plugin when you start facing this issue.

balwinder4264 avatar May 03 '19 15:05 balwinder4264

@UnleashedMind I tried #172 and it did not help me as it requires the following code to run react-native run-android --config=rn-cli.config.js while --config is not a part of the CLI. Do you have any suggestions?

RoniqueRicketts avatar Jun 19 '19 17:06 RoniqueRicketts

@UnleashedMind I tried #172 and it did not help me as it requires the following code to run react-native run-android --config=rn-cli.config.js while --config is not a part of the CLI. Do you have any suggestions?

After publishing this. I did the below setup and it worked.

  1. I created a file name rn-cli.config.js
  2. I then open the file and add ``` module.exports = { resolver: { blacklistRE: /#current-cloud-backend/.*/ } };
This is the same setup that other developers mention in issue #172 
3. I relaunch my Android Studio and run my Virtual Phone.
4. I run ``` react-native start --config=rn-cli.config.js --resetCache ``` and like Magic, my app was working. 
5. I am still to figure out how to get this to work with ``` react-native run-android ``` I'm open for suggestions. 


The issue is resolved for me. Thank you all for your help. 
TODAYS DATE 6/19/2019

RoniqueRicketts avatar Jun 19 '19 18:06 RoniqueRicketts

it's work for me https://github.com/aws/awsmobile-cli/issues/172#issuecomment-444445744

hsnMoghadasi avatar Sep 12 '19 08:09 hsnMoghadasi