6
votes

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.

3

3 Answers

1
votes

I solved it by adding a new file named "rn-cli.config.js" in the project root folder, with the following contents.

const blacklist = require('metro-config/src/defaults/blacklist');
module.exports = {
    resolver: {
        blacklistRE: blacklist([
            /node_modules\/.*\/node_modules\/react-native\/.*/,
        ])
    },
};
1
votes

I had this problem and I created a backup of the source files and deleted everything, the whole folder. Deleting node_modules wasn't enough. After getting the files back and using npm install for the packages, it worked.

1
votes

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\/.*/,
  },
};