Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jest shows warning about @providesModule naming collision after upgrade RN from 0.42.0 to 0.43.1 #13364

Closed
xareelee opened this issue Apr 7, 2017 · 46 comments
Labels
Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@xareelee
Copy link

xareelee commented Apr 7, 2017

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...
@xareelee xareelee changed the title Jest show warning and error after upgrade RN from 0.42.0 to 0.43.1 Jest shows warning about @providesModule naming collision after upgrade RN from 0.42.0 to 0.43.1 Apr 7, 2017
@xareelee
Copy link
Author

I found this issue has already reported on #11200.

But it still happened on RN 0.43.2.

@nowtech
Copy link

nowtech commented Apr 23, 2017

Im having same issue when adding react-native-router-flux to my project on RN 0.43.4

@nowtech
Copy link

nowtech commented Apr 25, 2017

Issue seems to be with react-native-router-flux 3.38.1 - goes away when rolling back to 3.38.0.

@ragibkl
Copy link

ragibkl commented Apr 28, 2017

Thanks @nowtech , I was struggling with this. I can confirm your workaround worked for me.

@ajostergaard
Copy link

I have this, or a similar, issue but don't use react-native-router-flux.

@ZevenFang
Copy link

+1

@AriaEdo
Copy link

AriaEdo commented Jun 14, 2017

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

@webdevbyjoss
Copy link

+1

@roderickfung
Copy link

this issue persists even if i'm not using react-native-router-flux

@jaimecorrea
Copy link

+1

4 similar comments
@ThatGuySam
Copy link

+1

@tuneZola
Copy link

+1

@airhawks
Copy link

+1

@justinhaaheim
Copy link

+1

@aaronbuchanan
Copy link

Also hitting this, any workarounds?

@nowtech
Copy link

nowtech commented Jun 22, 2017

Have you tried the rollback to react-native-router-flux 3.38.0?

@tuneZola
Copy link

I think this is coming from babel-preset-react-native 2.0.0, I had to role back to 1.9.2.

@flyher
Copy link

flyher commented Jun 23, 2017

+1 0.45.1

@edman193
Copy link

edman193 commented Jun 28, 2017

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

@justinhaaheim
Copy link

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...

@cooperka
Copy link
Contributor

cooperka commented Jul 2, 2017

For me this is caused by yarnpkg/yarn#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.

@mribbons
Copy link

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.

@mrhanta
Copy link

mrhanta commented Jul 17, 2017

This warning disappeared, when I upgrade npm to 5.3.0
I don't know why, but it works for me.

@Luavis
Copy link

Luavis commented Jul 24, 2017

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.

@gourav-singhal
Copy link

+1

1 similar comment
@BeyWood
Copy link

BeyWood commented Aug 3, 2017

+1

@danielkcz
Copy link

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

@woowalker
Copy link

woowalker commented Aug 21, 2017

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.

@dinithminura
Copy link

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?

@danielkcz
Copy link

danielkcz commented Aug 25, 2017

Are you guys using Watchman? As I said above, it solved it for me disabling Watchman.

@oberoi-ishant
Copy link

Same Error for every module:

jest-haste-map: @providesModule naming collision:

Any Solution?

@dominictracey
Copy link

+1

@lukewlms
Copy link

lukewlms commented Sep 6, 2017

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 react-native-router-flux@3.38.0 to your package.json dependencies.

@oberoi-ishant
Copy link

Hi,

I was able to get over it, by deleting npm_tmp directory. After that the error disappeared.

@rodrigobdz
Copy link

@ishantoberoi where is the npm_tmp directory? I can't find any documentation about it.

@fatinWasta
Copy link

+1
Going through same situation

@BeyWood
Copy link

BeyWood commented Sep 13, 2017

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

@stale
Copy link

stale bot commented Nov 12, 2017

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.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Nov 12, 2017
@stale stale bot closed this as completed Nov 19, 2017
@theGABS
Copy link

theGABS commented Nov 25, 2017

Have the same problem

@duanwencheng
Copy link

duanwencheng commented Dec 4, 2017

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

@chadhamre
Copy link

+1

@thadeu
Copy link

thadeu commented Dec 5, 2017

+1
Same error here as well.

@hiddentao
Copy link

Upgrading to npm@5.6.0 worked for me

@lchapoy
Copy link

lchapoy commented Mar 12, 2018

I Face the same issue, solution: erase jest-cache folder.

@MANTHAN-D
Copy link

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.

@anwarhamr
Copy link

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

@facebook facebook locked and limited conversation to collaborators May 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests