Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix React Native error "jest-haste-map: Haste module naming collision"?

When I installed react-native-popup-menu, I faced such error.

This is error code

Looking for JS files in
E:\react-native\.............\

Loading dependency graph...(node:9460) UnhandledPromiseRejectionWarning: Error: jest-haste-map: Haste module naming collision: Duplicate module name: react-native Paths: E:\react-native\.............\node_modules\react-native-twitter-signin\node_modules\react-native\package.json collides with E:\react-native\.............\node_modules\react-native\package.json

This error is caused by hasteImpl returning the same name for different files. at setModule (E:\react-native\.............\node_modules\jest-haste-map\build\index.js:551:17) at workerReply (E:\react-native\.............\node_modules\jest-haste-map\build\index.js:613:9) at process._tickCallback (internal/process/next_tick.js:68:7) (node:9460) 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:9460) [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:9460) UnhandledPromiseRejectionWarning: Error: jest-haste-map: Haste module naming collision: Duplicate module name: react-native Paths: E:\react-native\.............\node_modules\react-native-twitter-signin\node_modules\react-native\package.json collides with E:\react-native\.............\heybuddy\node_modules\react-native\package.json

This error is caused by hasteImpl returning the same name for different files. at setModule (E:\react-native\.............\node_modules\jest-haste-map\build\index.js:551:17) at workerReply (E:\react-native\.............\node_modules\jest-haste-map\build\index.js:613:9) at process._tickCallback (internal/process/next_tick.js:68:7) (node:9460) 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)

I tried to find the way to solve this error, but I can't find any solution.

like image 571
Jin Avatar asked Jan 28 '19 18:01

Jin


1 Answers

I solved it by creating a metro.config.js file in the root of the folder with this:

module.exports = {
  resolver: {
    blacklistRE: /#current-cloud-backend\/.*/,
  },
};
like image 178
yudhiesh Avatar answered Oct 07 '22 02:10

yudhiesh