amazon-archives / awsmobile-cli

CLI experience for Frontend developers in the JavaScript ecosystem.
Apache License 2.0
142 stars 35 forks source link

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

Open psalmdawg opened 5 years ago

psalmdawg commented 5 years ago

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)

torigeorge commented 5 years ago

Same issue here. Do you have an update?

UnleashedMind commented 5 years ago

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

balwinder4264 commented 5 years ago

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.

RoniqueRicketts commented 5 years ago

@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 commented 5 years ago

@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

hsnMoghadasi commented 5 years ago

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