Naming collision detected
when I execute ./packager/packager.sh, I see the error below!
Error building DepdendencyGraph: Error: Naming collision detected: /Users/guo/Desktop/react-native/node_modules/react-tools/src/shared/vendor/core/dom/isTextNode.js collides with /Users/guo/Desktop/react-native/AwesomeProject/node_modules/react-native/node_modules/react-tools/src/shared/vendor/core/dom/isTextNode.js at HasteMap._updateHasteMap (/Users/guo/Desktop/react-native/packager/react-packager/src/DependencyResolver/DependencyGraph/HasteMap.js:123:13) at /Users/guo/Desktop/react-native/packager/react-packager/src/DependencyResolver/DependencyGraph/HasteMap.js:95:28 at tryCallOne (/Users/guo/Desktop/react-native/node_modules/promise/lib/core.js:37:12) at /Users/guo/Desktop/react-native/node_modules/promise/lib/core.js:103:15 at flush (/Users/guo/Desktop/react-native/node_modules/promise/node_modules/asap/raw.js:50:29) at doNTCallback0 (node.js:417:9) at process._tickCallback (node.js:346:13)
@foghina @martinbigio I got the same error.
Some observations:
-
react-native init projectName and then npm start. npm start if broken however react-native start works. err:
sh: node_modules/react-native/packager/packager.sh: No such file or directory -
name collision detected error after doing react-native start.
I took master branch for generating the new project(changed the cli for this).
I'm getting similar error but its erroring out on react-tools, any ideas?
Error building DepdendencyGraph:
Error: Naming collision detected: /Users/corysmith/Apps/indieshuffle/node_modules/react-native/node_modules/react-tools/package.json collides with /Users/corysmith/Apps/indieshuffle/node_modules/react-native/packager/package.json
at HasteMap._updateHasteMap (/Users/corysmith/Apps/indieshuffle/node_modules/react-native/packager/react-packager/src/DependencyResolver/DependencyGraph/HasteMap.js:127:13)
at /Users/corysmith/Apps/indieshuffle/node_modules/react-native/packager/react-packager/src/DependencyResolver/DependencyGraph/HasteMap.js:104:32
at tryCallOne (/Users/corysmith/Apps/indieshuffle/node_modules/react-native/node_modules/promise/lib/core.js:37:12)
at /Users/corysmith/Apps/indieshuffle/node_modules/react-native/node_modules/promise/lib/core.js:103:15
at flush (/Users/corysmith/Apps/indieshuffle/node_modules/react-native/node_modules/promise/node_modules/asap/raw.js:50:29)
at doNTCallback0 (node.js:407:9)
at process._tickCallback (node.js:336:13)
I'm getting similar error too after adding react-native-router
Error building DepdendencyGraph: Error: Naming collision detected: /Users/andrej/projects/test/testProject/node_modules/react-native-router/node_modules/react-native/Libraries/Promise.js collides with /Users/andrej/projects/test/testProject/node_modules/react-native/Libraries/Promise.js at HasteMap._updateHasteMap (/Users/andrej/projects/test/testProject/node_modules/react-native/packager/react-packager/src/DependencyResolver/DependencyGraph/HasteMap.js:123:13) at /Users/andrej/projects/test/testProject/node_modules/react-native/packager/react-packager/src/DependencyResolver/DependencyGraph/HasteMap.js:95:28 at tryCallOne (/Users/andrej/projects/test/testProject/node_modules/react-native/node_modules/promise/lib/core.js:37:12) at /Users/andrej/projects/test/testProject/node_modules/react-native/node_modules/promise/lib/core.js:103:15 at flush (/Users/andrej/projects/test/testProject/node_modules/react-native/node_modules/promise/node_modules/asap/raw.js:50:29) at doNTCallback0 (node.js:407:9) at process._tickCallback (node.js:336:13)
If your are stuck up here So have a solution for this but not forever you can delete you react-native folder from node_module/react-native-router/node_module/react-native and you can use react-native from node_module/react-native
I fixed a similar issue to the duplicated module one on dee96fbedcd600e8819019005ae75ffbee2246f0. In regards the packager.sh, that one should have been fixed on 32aeeea3135fbb504b1481c0e7cbad1ddf1ae057.
Please reopen if any of this still repro :)
cc @mkonicek in case you've seen the naming colision mentioned on the task
This Promise issue looks legimit, sorry for closing. @mkonicek we don't have a strategy for dealing with this inside the packager, it just doesn't support having the same haste module defined twice. Fortunately, the new CLI brings the getBlacklistedRE function to the user on rn-cli.config.js so people should be able to blacklist the ones they want to get rid. Not sure if we can do anything in the mean time.
@martinbigio I have an idea for how to handle duplicate Haste modules by scoping them. I don't have the bandwidth to build it myself but will describe my vision for it in a new issue.
@ide, I think part of this will be solved by the issue we were just chatting about, which is that haste modules outside of react-native, react-tools, and currently, due to AsyncStorage, parse, shouldn't be used at all. Duplicate Haste module scoping would be cool, but I think fixing this other issue (which I plan to do ASAP) will solve most cases.
@skevy so just to be clear -- you want to fix deep dependencies so that we don't run javascript for Node on a platform.. that's not Node?
Wait, what? I don't think I said that. I'm confused by your response.
All I was saying was that the issue described here would be resolved by @providesModule not being used by the packager for packages outside of the FB ecosystem.
Oh i see. I thought you were referring to honoring the "browser" entry in the JSON.
No no...we should have the 'react-native' directive.
What things should I know before adding to the blacklist file? as it is Im getting
Error building DepdendencyGraph: Error: Naming collision detected: .../main_application/node_modules/react-native/node_modules/react-tools/src/shared/vendor/core/warning.js collides with .../main_application/node_modules/react-native/node_modules/react-tools/docs/js/react.js at HasteMap._updateHasteMap (.../main_application/node_modules/react-native/packager/react-packager/src/DependencyResolver/DependencyGraph/HasteMap.js:123:13) at .../main_application/node_modules/react-native/packager/react-packager/src/DependencyResolver/DependencyGraph/HasteMap.js:95:28 at tryCallOne (.../main_application/node_modules/react-native/node_modules/promise/lib/core.js:37:12) at .../main_application/node_modules/react-native/node_modules/promise/lib/core.js:103:15 at flush (.../main_application/node_modules/react-native/node_modules/promise/node_modules/asap/raw.js:50:29) at doNTCallback0 (node.js:417:9) at process._tickCallback (node.js:346:13)
when I add warning.js and also one other file to the blacklist the packager starts but I run into issues once the application starts
@mangogogos i got the same situation,
Error building DepdendencyGraph:
Error: Naming collision detected: E:\Andriod\AwesomeProject\node_modules\react-native\node_modules\react-tools\src\shared\vendor\core\warning.js collides with E:\Andriod\AwesomeProject\node_modules\react-native\node_modules\react-tools\docs\js\react.js
at HasteMap._updateHasteMap (E:/Andriod/AwesomeProject/node_modules/react-native/packager/react-packager/src/DependencyResolver/DependencyGraph/HasteMap.js:123:13)
at E:/Andriod/AwesomeProject/node_modules/react-native/packager/react-packager/src/DependencyResolver/DependencyGraph/HasteMap.js:95:28
at tryCallOne (E:\Andriod\AwesomeProject\node_modules\react-native\node_modules\promise\lib\core.js:37:12)
at E:\Andriod\AwesomeProject\node_modules\react-native\node_modules\promise\lib\core.js:103:15
at flush (E:\Andriod\AwesomeProject\node_modules\react-native\node_modules\promise\node_modules\asap\raw.js:50:29)
at doNTCallback0 (node.js:417:9)
at process._tickCallback (node.js:346:13)
PS E:\Andriod\AwesomeProject> react-native -v
0.1.7
PS E:\Andriod\AwesomeProject>
in my node_modules,there is only react-native, no more others. so who can help?
I have the same issue
Same problem here. I found a workaround: npm prune && npm i
It happened to me when I changed some dependencies in my project. Running ./node_modules/react-native/packager/packager.sh --resetCache fixed the dependencies issue.
Is there a way to exclude a folder from the packaging?
@jpapillon solution don't works for me