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

npm test fails with naming collision #23

Closed
jwhitley opened this issue Mar 5, 2016 · 3 comments
Closed

npm test fails with naming collision #23

jwhitley opened this issue Mar 5, 2016 · 3 comments

Comments

@jwhitley
Copy link

jwhitley commented Mar 5, 2016

Repro steps:

  1. git clone https://github.com/benoitvallon/react-native-nw-react-calculator
  2. cd react-native-nw-react-calculator
  3. npm install
  4. npm install (again, per discussion in Fix Jest CLI error causing Jest tests to not run (using Jest CLI v 0.… #3)
  5. npm test

Actual results:

koi:✓:react-native-nw-react-calculator>> npm test

> ReactNativeNWReactCalculator@1.0.0 test /Users/whitley/src/3p/react-native-nw-react-calculator
> jest

Using Jest CLI v0.9.0, jasmine2

Error: Failed to build DependencyGraph: @providesModule naming collision:
  Duplicate module name: xhrSimpleDataSerializer
  Paths: /Users/whitley/src/3p/react-native-nw-react-calculator/node_modules/react-native/node_modules/fbjs/lib/xhrSimpleDataSerializer.js collides with /Users/whitley/src/3p/react-native-nw-react-calculator/node_modules/flux/node_modules/fbjs/flow/include/xhrSimpleDataSerializer.js

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

This is most likely a setup or configuration issue. To resolve a module name collision, change or blacklist one of the offending modules. See http://facebook.github.io/jest/docs/api.html#config-modulepathignorepatterns-array-string
npm ERR! Test failed.  See above for more details.

I've tried to repro with both node v5.5.0 (npm v3.3.12) and node v5.7.0 (npm v3.6.0), with the same error each time.

FWIW, I ended up here after having similar naming collision errors plaguing my attempts to bring up jest-based tests in a new RN project I'm working on. (BTW, thanks a LOT for including tests here. Very few public RN projects seem to bother.) I'm at a loss as to what could be causing this, aside from it being at least superficially related to facebook/react-native#3625 and facebook/react-native#3618. But those have been hanging around for some time, meanwhile the discussion on issues and PRs here suggest that the tests have been running well for you and others.

Any ideas?

@benoitvallon
Copy link
Owner

Yes, I know :) I am waiting for travis to finish the tests but it is already fixed. I will merge as soon as the tests will be finished.

Thanks for your issue.

@jwhitley
Copy link
Author

jwhitley commented Mar 5, 2016

@benoitvallon Wonderful, thanks!

@benoitvallon
Copy link
Owner

The code is pushed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants