d-a-n / react-native-webbrowser

A cross-platform (iOS / Android), full-featured, highly customizable web browser module for React Native apps.
MIT License
205 stars 73 forks source link

Fail to build in react-native run-ios #2

Open fungilation opened 8 years ago

fungilation commented 8 years ago

This is on latest RN 0.22.

[4:05:56 PM] <START> Building Dependency Graph
[4:05:56 PM] <START> Crawling File System
[Hot Module Replacement] Server listening on /hot

React packager ready.

[4:05:57 PM] <END>   Crawling File System (1062ms)
[4:05:57 PM] <START> Building in-memory fs for JavaScript
[4:05:57 PM] <END>   Building in-memory fs for JavaScript (172ms)
[4:05:57 PM] <START> Building in-memory fs for Assets
[4:05:57 PM] <END>   Building in-memory fs for Assets (127ms)
[4:05:57 PM] <START> Building Haste Map
[4:05:57 PM] <START> Building (deprecated) Asset Map
[4:05:57 PM] <END>   Building (deprecated) Asset Map (35ms)
Failed to build DependencyGraph: @providesModule naming collision:
  Duplicate module name: TouchHistoryMath
  Paths: ~/Documents/code/<app>/node_modules/react-native-webbrowser/node_modules/react-native/Libraries/vendor/react/browser/eventPlugins/TouchHistoryMath.js collides with ~/Documents/code/<app>/node_modules/react-native/Libraries/vendor/react/browser/eventPlugins/TouchHistoryMath.js

This error is caused by a @providesModule declaration with the same name accross two different files.
Error: @providesModule naming collision:
  Duplicate module name: TouchHistoryMath
  Paths: ~/Documents/code/<app>/node_modules/react-native-webbrowser/node_modules/react-native/Libraries/vendor/react/browser/eventPlugins/TouchHistoryMath.js collides with ~/Documents/code/<app>/node_modules/react-native/Libraries/vendor/react/browser/eventPlugins/TouchHistoryMath.js

This error is caused by a @providesModule declaration with the same name accross two different files.
    at HasteMap._updateHasteMap (~/Documents/code/<app>/node_modules/node-haste/lib/DependencyGraph/HasteMap.js:160:15)
    at ~/Documents/code/<app>/node_modules/node-haste/lib/DependencyGraph/HasteMap.js:125:25
    at run (~/Documents/code/<app>/node_modules/babel-polyfill/node_modules/core-js/modules/es6.promise.js:89:22)
    at ~/Documents/code/<app>/node_modules/babel-polyfill/node_modules/core-js/modules/es6.promise.js:102:28
    at flush (~/Documents/code/<app>/node_modules/babel-polyfill/node_modules/core-js/modules/_microtask.js:14:5)
    at _combinedTickCallback (node.js:376:9)
    at process._tickCallback (node.js:407:11)
~
Process terminated. Press <enter> to close the window
tuneZola commented 8 years ago

I am having the same issue after an upgrade.

rwngallego commented 8 years ago

Having the same issue after installing it. I'm working on Ubuntu 14.04 LTS, npm v3.7.3 and NodeJS v4.2.6:

[1:56:41 PM] <END>   Building (deprecated) Asset Map (315ms)
Failed to build DependencyGraph: Naming collision detected: /home/dev/Sandbox/react/AndroidClient/node_modules/react-native/Libraries/vendor/react/platformImplementations/universal/worker/UniversalWorkerNodeHandle.js collides with /home/dev/Sandbox/react/AndroidClient/node_modules/react-native-webbrowser/node_modules/react-native/Libraries/vendor/react/platformImplementations/universal/worker/UniversalWorkerNodeHandle.js
Error: Naming collision detected: /home/dev/Sandbox/react/AndroidClient/node_modules/react-native/Libraries/vendor/react/platformImplementations/universal/worker/UniversalWorkerNodeHandle.js collides with /home/dev/Sandbox/react/AndroidClient/node_modules/react-native-webbrowser/node_modules/react-native/Libraries/vendor/react/platformImplementations/universal/worker/UniversalWorkerNodeHandle.js
    at HasteMap._updateHasteMap (HasteMap.js:132:13)
    at HasteMap.js:103:28
    at tryCallOne (/home/dev/Sandbox/react/AndroidClient/node_modules/promise/lib/core.js:37:12)
    at /home/dev/Sandbox/react/AndroidClient/node_modules/promise/lib/core.js:123:15
    at flush (/home/dev/Sandbox/react/AndroidClient/node_modules/asap/raw.js:50:29)
    at nextTickCallbackWith0Args (node.js:419:9)
    at process._tickCallback (node.js:348:13)
rwngallego commented 8 years ago

It has a redundant dependency to react-native:

https://github.com/d-a-n/react-native-webbrowser/blob/master/package.json#L33

I just removed that dependency, deleted the react-native folder from react-native-webbrowser/node_modules and run again:

react-native start

and it worked.

Etheryte commented 8 years ago

Chiming in because this issue is one of the top search results for other similar issues.

This error means one of your packages has a redundant or incompatible dependency, check the referenced paths. Most of the time you can fix the issue simply by updating the package.json for the offending package. If everything works fine, don't forget to make a pull request for the said package.

arled commented 6 years ago

Shame this isn't maintained