Create-react-native-app: jest-haste-map: @providesModule naming collision

Created on 5 May 2017  Â·  20Comments  Â·  Source: expo/create-react-native-app

after run 'create-react-native-app my-app', and then run 'npm run ios',I got error:

jest-haste-map: @providesModule naming collision:
Duplicate module name: glob
Paths: /Users/guhaoxin/Desktop/react-native-workspace/gank/node_modules/react-native/node_modules/rimraf/node_modules/glob/package.json collides with /Users/guhaoxin/Desktop/react-native-workspace/gank/node_modules/react-native/node_modules/glob/package.json

This warning is caused by a @providesModule declaration with the same name across two different files.

Most helpful comment

similar issue but Duplicate module name: fb-watchman , Duplicate module name: bser

Loading dependency graph...jest-haste-map: @providesModule naming collision:
  Duplicate module name: bser
  Paths: ...

This warning is caused by a @providesModule declaration with the same name across two different files.
jest-haste-map: @providesModule naming collision:
  Duplicate module name: fb-watchman
  Paths: ...

This warning is caused by a @providesModule declaration with the same name across two different files.
jest-haste-map: @providesModule naming collision:
  Duplicate module name: bser
  Paths: ...

All 20 comments

This seems to be a react-native and [email protected] issue. The same issue is affecting me when upgrading in my standard react-native app.

similar issue but Duplicate module name: fb-watchman , Duplicate module name: bser

Loading dependency graph...jest-haste-map: @providesModule naming collision:
  Duplicate module name: bser
  Paths: ...

This warning is caused by a @providesModule declaration with the same name across two different files.
jest-haste-map: @providesModule naming collision:
  Duplicate module name: fb-watchman
  Paths: ...

This warning is caused by a @providesModule declaration with the same name across two different files.
jest-haste-map: @providesModule naming collision:
  Duplicate module name: bser
  Paths: ...

having same exact problems.. this is my package.json

{
  "name": "xxx",
  "version": "7.0.0",
  "private": true,
  "devDependencies": {
    "babel-jest": "17.0.0",
    "babel-preset-react-native": "1.9.0",
    "chai": "^3.5.0",
    "jest": "17.0.0",
    "jest-expo": "~1.0.1",
    "jest-react-native": "17.0.0",
    "mocha": "^2.5.3",
    "react-native-scripts": "0.0.30",
    "react-test-renderer": "16.0.0-alpha.6",
    "remote-redux-devtools": "^0.3.3",
    "remote-redux-devtools-on-debugger": "^0.4.6"
  },
  "main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
  "scripts": {
    "postinstall": "remotedev-debugger",
    "start": "react-native-scripts start",
    "eject": "react-native-scripts eject",
    "android": "react-native-scripts android",
    "ios": "react-native-scripts ios",
    "test": "node node_modules/jest/bin/jest.js --watch"
  },
  "jest": {
    "preset": "jest-expo"
  },
  "dependencies": {
    "@expo/vector-icons": "~5.0.0",
    "expo": "^17.0.0",
    "lodash": "^4.13.1",
    "moment": "^2.13.0",
    "native-base": "2.1.4",
    "react": "16.0.0-alpha.6",
    "react-native": "github:exponent/react-native#sdk-17.0.0",
    "react-native-camera-roll-picker": "^1.1.9",
    "react-native-gifted-chat": "0.1.3",
    "react-native-modalbox": "^1.3.7",
    "react-native-multi-slider": "^0.3.5",
    "react-native-router-flux": "3.38.0",
    "react-native-scrollable-tab-view": "^0.7.2",
    "react-native-swiper": "^1.5.4",
    "react-redux": "^4.4.5",
    "redux": "^3.5.2",
    "redux-persist": "^3.2.2",
    "redux-thunk": "^2.1.0"
  }
}

:+1: same issue

same problem.

+1

if you use jest-expo, don't install other versions of jest :) additionally, this is a problem with the react-native packager / haste module system that there is work in progress to attempt to resolve. it's not due to create-react-native-app itself so I'll close the issue here and you can track in the issue mentioned above by @ajostergaard

+1

same issue. how can i resolve it please?.

Same issue ?? +1

+1

Adding jest --clearCache before starting React Native fixed it for me, i.e.:
"scripts": {
"start": "yarn jest --clearCache && react-native-scripts start",

For me Problem was, watchman path in windows environment variables. Removing that unused path fixed problem for me. Hope this helps to someone.

@ajostergaard ,
Is the issue solved? can I know the solution?

Let me know in details. Is this the first time you are starting that project entirely? that will make me know where we could really pin point where the problem is coming from.

I am facing the issue on RN 0.56 and xcode 9.4.
I tried giving the path for React in my pod file to node_modules/react-native but still it installs a React folder to pods/ .
Can someone please explain how to fix this bug

p.s I updated our app from a older version (0.44) to 0.56. Created a new build and moved the src code. It was a long journey but now I am stuck with this issue.

I had this same problem as well but was able to fix it by removing pod files installed in ios/Pods

And then clearing cache

@ameshkin
rm -rf ios/Pods
pod install

how to clear cache?

ios/Podfile

I commented out it. I didn't wrote the line but it automatically wrote...

  # pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'

and pod install again. it works.

Was this page helpful?
0 / 5 - 0 ratings