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

fbemitter collides with react-native/libraries/EventEmitter when adding watchman to path #15186

Closed
rksh1997 opened this issue Jul 25, 2017 · 3 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@rksh1997
Copy link

rksh1997 commented Jul 25, 2017

Is this a bug report?

Bug

Have you read the Bugs section of the How to Contribute guide?

Yes

Environment

react-native: 0.45.1
node 6.5.0
npm 3.10.3
yarn 0.21.3

  • Target Platform:
    Android

  • Development Operating System:
    Windows 10 Enterprise

  • Build tools: Android Studio

Steps to Reproduce

1- I add watchman to PATH
2- cd myProject & yarn start or yarn start android
3- it logs me this:

$ react-native-scripts start
08:54:05: Starting packager...
***ERROR STARTING PACKAGER***
Starting React Native packager...
Scanning 740 folders for symlinks in C:\TEST\node_modules (16ms)
Loading dependency graph.
Running packager on port 19001.


jest-haste-map: @providesModule naming collision:
  Duplicate module name: EventSubscriptionVendor
  Paths: C:/TEST\node_modules/fbemitter/lib/EventSubscriptionVendor.js collides with C:/TEST\node_modules/react-native/Libraries/EventEmitter/EventSubscriptionVendor.js

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

jest-haste-map: @providesModule naming collision:
  Duplicate module name: EventSubscription
  Paths: C:/TEST\node_modules/fbemitter/lib/EventSubscription.js collides with C:/TEST\node_modules/react-native/Libraries/EventEmitter/EventSubscription.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: EmitterSubscription
  Paths: C:/TEST\node_modules/fbemitter/lib/EmitterSubscription.js collides with C:/TEST\node_modules/react-native/Libraries/EventEmitter/EmitterSubscription.js

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

4- run my app on expo (on the virtual device)
5- error with reponse code 500 that tells it couldn't resolve the 3 modules above.

I tried deleting node_modules and re-installing them and this didn't work.
I tried cleaning npm & yarn caches.
I tried deleting watchman watches.
I had to create new react native app and then getting the old source from git.

the problem won't happen if I don't have watchman in my PATH, but one I run yarn start and watchman in PATH, the whole project becomes broken and needs to re-create.

Expected Behavior

I expected expo to load all modules and run the app like before adding watchman to my PATH.

Actual Behavior

some modules are lost from the modules map, because they exists in folders but npm couldn't find them

Reproducible Demo

it's just the app created by create-react-native-app

@rksh1997 rksh1997 changed the title losing node_modules when adding watchman to PATH fbemitter collides with react-native/libraries/EventEmitter Jul 25, 2017
@rksh1997 rksh1997 changed the title fbemitter collides with react-native/libraries/EventEmitter fbemitter collied with react-native/libraries/EventEmitter when adding watchman to path Jul 25, 2017
@rksh1997 rksh1997 changed the title fbemitter collied with react-native/libraries/EventEmitter when adding watchman to path fbemitter collides with react-native/libraries/EventEmitter when adding watchman to path Jul 25, 2017
@hramos
Copy link
Contributor

hramos commented Jul 25, 2017

Have you tried using React Native 0.46.4?

@rksh1997
Copy link
Author

@hramos Yes I did and it did the same issue.

@rksh1997
Copy link
Author

rksh1997 commented Aug 2, 2017

@hramos
I fixed this issue by editing node_modules/jest-haste-map/build/crawlers/watchman.js
line 107 was:

const name = root + path.sep + fileData.name;

I changed it to:

let name = root + path.sep + fileData.name;
name = name.replace(/\//g, '\\');

@rksh1997 rksh1997 closed this as completed Aug 2, 2017
@facebook facebook locked as resolved and limited conversation to collaborators Aug 2, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Aug 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

3 participants