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

Packager error: naming collision AutoFocusUtils #10

Closed
edhemphill opened this issue Jul 9, 2016 · 1 comment
Closed

Packager error: naming collision AutoFocusUtils #10

edhemphill opened this issue Jul 9, 2016 · 1 comment

Comments

@edhemphill
Copy link

edhemphill commented Jul 9, 2016

Thanks for the outstanding demo app!

There appears to be a conflict with an inner module using it's own react. The error from the packager look like this:

Failed to build DependencyGraph: @providesModule naming collision:
  Duplicate module name: AutoFocusUtils
  Paths: /Work/FinanceReactNative/node_modules/react-native-router-flux/node_modules/react-native-experimental-navigation/node_modules/react/lib/AutoFocusUtils.js collides with /Work/FinanceReactNative/node_modules/react/lib/AutoFocusUtils.js

This error is caused by a @providesModule declaration with the same name accross two different files.
Error: @providesModule naming collision:
  Duplicate module name: AutoFocusUtils
  Paths: /Work/FinanceReactNative/node_modules/react-native-router-flux/node_modules/react-native-experimental-navigation/node_modules/react/lib/AutoFocusUtils.js collides with /Work/FinanceReactNative/node_modules/react/lib/AutoFocusUtils.js

This error is caused by a @providesModule declaration with the same name accross two different files.
    at HasteMap._updateHasteMap (/Work/FinanceReactNative/node_modules/react-native/node_modules/node-haste/lib/DependencyGraph/HasteMap.js:160:15)
    at /Work/FinanceReactNative/node_modules/react-native/node_modules/node-haste/lib/DependencyGraph/HasteMap.js:125:25

This is because react-native-router-flux ends up including a react copy itself.

My workaround for this was making a rn-cli.config.js file in the root of the project, with this code (adjust your regex as needed):

var blacklist = require('react-native/packager/blacklist');

var config = {
  getBlacklistRE(platform) {
    return blacklist(platform, [
      /FinanceReactNative\/node_modules\/react-native-router-flux\/node_modules\/react-native-experimental-navigation\/node_modules\/react\/.*/
    ]);
  }
};

module.exports = config;

More info on a similar issue here

@7kfpun
Copy link
Owner

7kfpun commented Aug 8, 2016

Thanks @edhemphill !!

@7kfpun 7kfpun closed this as completed Oct 9, 2016
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