Skip to content
This repository has been archived by the owner on Sep 17, 2021. It is now read-only.

Running example fails to build DependencyGraph: @providesModule naming collision #95

Closed
vtsatskin opened this issue Feb 24, 2017 · 4 comments

Comments

@vtsatskin
Copy link

The react native packager yields an error when attempting to run the example application on iOS. I'm using the following versions of react-native:

  • react-native-cli: 1.2.0
  • react-native: 0.41.2
  • iOS Simulator 10.2

Steps to reproduce

git clone capitalone/react-native-pathjs-charts
cd react-native-pathjs-charts
git checkout tags/0.0.26
cd example
yarn install
react-native link react-native-svg
react-native run-ios

Error

~/Code/FYDP/external/react-native-pathjs-charts/example/node_modules/react-native/packager ~
Scanning 472 folders for symlinks in /Users/vt/Code/FYDP/external/react-native-pathjs-charts/example/node_modules (29ms)
 ┌────────────────────────────────────────────────────────────────────────────┐ 
 │  Running packager on port 8081.                                            │ 
 │                                                                            │ 
 │  Keep this packager running while developing on any JS projects. Feel      │ 
 │  free to close this tab and run your own packager instance if you          │ 
 │  prefer.                                                                   │ 
 │                                                                            │ 
 │  https://github.com/facebook/react-native                                  │ 
 │                                                                            │ 
 └────────────────────────────────────────────────────────────────────────────┘ 
Looking for JS files in
   /Users/vt/Code/FYDP/external/react-native-pathjs-charts/example 

Loading dependency graph...
React packager ready.

Failed to build DependencyGraph: @providesModule naming collision:
  Duplicate module name: react-native-vector-icons
  Paths: /Users/vt/Code/FYDP/external/react-native-pathjs-charts/example/node_modules/react-native/local-cli/core/__fixtures__/files/package.json collides with /Users/vt/Code/FYDP/external/react-native-pathjs-charts/example/node_modules/react-native-pathjs-charts/node_modules/react-native/local-cli/core/__fixtures__/files/package.json

This error is caused by a @providesModule declaration with the same name across two different files.
Error: @providesModule naming collision:
  Duplicate module name: react-native-vector-icons
  Paths: /Users/vt/Code/FYDP/external/react-native-pathjs-charts/example/node_modules/react-native/local-cli/core/__fixtures__/files/package.json collides with /Users/vt/Code/FYDP/external/react-native-pathjs-charts/example/node_modules/react-native-pathjs-charts/node_modules/react-native/local-cli/core/__fixtures__/files/package.json

This error is caused by a @providesModule declaration with the same name across two different files.
    at HasteMap._updateHasteMap (/Users/vt/Code/FYDP/external/react-native-pathjs-charts/example/node_modules/react-native/packager/react-packager/src/node-haste/DependencyGraph/HasteMap.js:158:13)
    at p.getName.then.name (/Users/vt/Code/FYDP/external/react-native-pathjs-charts/example/node_modules/react-native/packager/react-packager/src/node-haste/DependencyGraph/HasteMap.js:133:31)
~
Process terminated. Press <enter> to close the window
@marzolfb
Copy link
Contributor

I tried this out myself and can't reproduce the same behavior you're seeing though I did run into some problems. First though, what version of yarn are you running with?

When I installed yarn on mac the first time with brew update && brew install yarn, it downloaded and installed version 0.20.3 which looking at the yarn release page on github appears to be a pre-release version (because the 0.18.2 version is labelled as the latest version). Anyways, when I did yarn install from the example directory, I got an error which you don't seem to have received in your example above. My yarn install output on 0.20.3 looked like this:

warning react-native > xcode > node-uuid@1.4.7: use uuid module instead
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
error An unexpected error occurred: "ENOENT: no such file or directory, lstat '/Users/Applications'".
...

which seems to indicate that yarn (or this specific version of yarn) doesn't like the relative path spec in the example package.json:

"dependencies": {
...
"react-native-pathjs-charts": "file:../",

It looks like yarnpkg/yarn#1498 fixed several issues logged with similar behavior to what I experienced. The last comment on that PR was that it was fixed in 0.18.0 and when I went to the yarn releases page, I saw that 0.18.2 was the official latest release, so then I went and followed the directions here to install that specific version:

curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 0.18.2 

Once I did that I was able to run the example app successfully with react-native run-ios

If you are using a different yarn version than 0.18.2, could you try installing this version and using it and seeing if you have the same problem?

@vtsatskin
Copy link
Author

I'll try this out this weekend.

@vtsatskin
Copy link
Author

vtsatskin commented Mar 1, 2017

I was running yarn 0.16.1 when I reported this bug. I ran the following to update yarn to 0.21.3:

brew update
brew upgrade yarn

Running the original steps to reproduce again yields a successful app that runs.

Trying your specific version of yarn 0.18.2 also works.

Thanks for helping figure this out @marzolfb!

@marzolfb
Copy link
Contributor

marzolfb commented Mar 1, 2017

Great! Thanks for verifying!

@marzolfb marzolfb closed this as completed Mar 1, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants