After upgrading RN from 0.42.0 to 0.43.1, jest shows warning about @providesModule naming collision:
$ jest --no-cache
jest-haste-map: @providesModule naming collision:
Duplicate module name: babel-generator
Paths: {path_to_project}/node_modules/react-native/node_modules/babel-register/node_modules/babel-generator/package.json collides with {path_to_project}/node_modules/react-native/node_modules/babel-core/node_modules/babel-core/node_modules/babel-generator/package.json
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: babel-core
Paths: {path_to_project}/node_modules/react-native/node_modules/babel-core/package.json collides with {path_to_project}/node_modules/react-native/node_modules/babel-register/node_modules/babel-core/package.json
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: babel-register
Paths: {path_to_project}/node_modules/react-native/node_modules/babel-register/package.json collides with {path_to_project}/node_modules/react-native/node_modules/babel-register/node_modules/babel-register/package.json
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: json5
Paths: {path_to_project}/node_modules/react-native/node_modules/json5/package.json collides with {path_to_project}/node_modules/react-native/node_modules/babel-register/node_modules/json5/package.json
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: babel-core
Paths: {path_to_project}/node_modules/react-native/node_modules/babel-core/node_modules/babel-core/package.json collides with {path_to_project}/node_modules/react-native/node_modules/babel-core/package.json
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: babel-register
Paths: {path_to_project}/node_modules/react-native/node_modules/babel-core/node_modules/babel-register/package.json collides with {path_to_project}/node_modules/react-native/node_modules/babel-register/package.json
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: json5
Paths: {path_to_project}/node_modules/react-native/node_modules/babel-core/node_modules/json5/package.json collides with {path_to_project}/node_modules/react-native/node_modules/json5/package.json
This warning is caused by a @providesModule declaration with the same name across two different files.
// Start running tests...
I found this issue has already reported on https://github.com/facebook/react-native/issues/11200.
But it still happened on RN 0.43.2.
Im having same issue when adding react-native-router-flux to my project on RN 0.43.4
Issue seems to be with react-native-router-flux 3.38.1 - goes away when rolling back to 3.38.0.
Thanks @nowtech , I was struggling with this. I can confirm your workaround worked for me.
I have this, or a similar, issue but don't use react-native-router-flux.
+1
Duplicate module name: fb-watchman
../app/node_modules/react-native/node_modules/fb-watchman/package.json
collides with
../app/node_modules/react-native/node_modules/jest-haste-map/node_modules/sane/node_modules/fb-watchman/package.json
RN upgrade from 0.44.0 > 0.45.1
+1
this issue persists even if i'm not using react-native-router-flux
+1
+1
+1
+1
+1
Also hitting this, any workarounds?
Have you tried the rollback to react-native-router-flux 3.38.0?
I think this is coming from babel-preset-react-native 2.0.0, I had to role back to 1.9.2.
+1 0.45.1
I have similar issue, but the collision is with module: react-native-draggable-board
@providesModule naming collision:
Duplicate module name: TouchHistoryMath
Paths:
/home/edgar/Alce/react_native/AciTimeTracking/node_modules/react-native/Libraries/Renderer/src/renderers/shared/shared/event/eventPlugins/TouchHistoryMath.js
collides with
/home/edgar/Alce/react_native/AciTimeTracking/node_modules/react-native-draggable-board/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/event/eventPlugins/TouchHistoryMath.js
I was able to resolve this by rolling my project back to react-native 0.42.3, which I did in part to avoid the dependency on the react 16 alpha releases. Still not sure why they have the stable releases of react-native (ie 0.43+) depending on an alpha release...
For me this is caused by https://github.com/yarnpkg/yarn/issues/1334. Installing with npm (instead of yarn) fixes it for now.
Another workaround is to add a postinstall script to rm -rf node_modules/my-library/node_modules.
This happened to me for every module. Instead of doing rm -rf node_modules, I just renamed them to node_modules1, node_modules2. I had to move them outside the app to remove the error.
This warning disappeared, when I upgrade npm to 5.3.0
I don't know why, but it works for me.
I also have same problem when I upgrade react native from 0.40 to 0.46. I upgrade npm to 5.3.0 and it works for me.
+1
+1
This problem seems to disappear when I rename folder where I have installed Watchman so apparently it's related to it. Unfortunately, I need the watchman for some other things so it's kinda stalemate.
Windows 10 x64
react-native 0.46.1
jest-expo 19.0..0
meet it in 0.45.1
jest-haste-map: @providesModule naming collision:
Duplicate module name: core-js
Paths: {path_to_project}/node_modules/react-native/node_modules/core-js/package.json collides with {path_to_project}/node_modules/react-native/node_modules/fbjs/node_modules/core-js/package.json
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: base64-js
Paths: {path_to_project}/node_modules/react-native/node_modules/base64-js/package.json collides with {path_to_project}/node_modules/react-native/node_modules/simple-plist/node_modules/base64-js/package.json
This warning is caused by a @providesModule declaration with the same name across two different files.
is there any solution ?
by the way, i just delete the 'node_modules' folder which under the folder 'fbjs' and floder 'simple-plist', and the warning gone.
Having the same issue as follows, ( Upgrading react-native from 0.36.0 to 0.47.1 )
Loading dependency graph...jest-haste-map: @providesModule naming collision:
Duplicate module name: assert-plus
Paths: project_path/node_modules/react-native/node_modules/fsevents/node_modules/sshpk/node_modules/assert-plus/package.json collides with project_path/node_modules/react-native/node_modules/fsevents/node_modules/dashdash/node_modules/assert-plus/package.json
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: regenerator-runtime
Paths: project_path/node_modules/react-native/node_modules/babel-runtime/node_modules/regenerator-runtime/package.json collides with project_path/node_modules/react-native/node_modules/babel-polyfill/node_modules/regenerator-runtime/package.json
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: debug
Paths: project_path/node_modules/react-native/node_modules/babel-traverse/node_modules/debug/package.json collides with project_path/node_modules/react-native/node_modules/babel-core/node_modules/debug/package.json
.
.
.
I tried deleting node modules and reinstalling, not success. Any solution?
Are you guys using Watchman? As I said above, it solved it for me disabling Watchman.
Same Error for every module:
Any Solution?
+1
We didn't have react-native-router-flux in our dependencies - adding a specific dependency on 3.38.0 took care of these errors.
If you're not specifically referencing react-native-router-flux in package.json but are using react-native, try adding [email protected] to your package.json dependencies.
Hi,
I was able to get over it, by deleting npm_tmp directory. After that the error disappeared.
@ishantoberoi where is the npm_tmp directory? I can't find any documentation about it.
+1
Going through same situation
i solve the problem
(it's reactNative's bug,when you npm install the nodemodules some files been removed!)
so just re init the nodemodules and yarn add you project
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions.
Have the same problem
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: .../node_modules/react-native/node_modules/fb-watchman/package.json collides with .../node_modules/react-native/node_modules/jest-haste-map/node_modules/sane/node_modules/fb-watchman/package.json
+1
+1
Same error here as well.
Upgrading to [email protected] worked for me
I Face the same issue, solution: erase jest-cache folder.
I am still facing the issue. I have npm version as 5.6.0 and jest version as ^22.4.3. I get errors for duplication.
I'm getting this issue after following instruction to bring in Firebase. I already had crashlytics working but after following update instructions it's all jacked. https://www.fabric.io/epitel-inc/ios/apps/com.epitel.aura-test/firebase/answers-events/update-sdk
I'm getting this message over and over again for probably all my modules.
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: Promise
Paths: /user/my-project/node_modules/react-native/Libraries/Promise.js collides with /user/my-project/ios/Pods/React/Libraries/Promise.js
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: react-native
Paths: /user/my-project/node_modules/react-native/package.json collides with /user/my-project/ios/Pods/React/package.json
Most helpful comment
this issue persists even if i'm not using react-native-router-flux