react-native icon indicating copy to clipboard operation
react-native copied to clipboard

Naming collision detected

Open chenchen1008 opened this issue 11 years ago • 46 comments

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)

chenchen1008 avatar Oct 21 '15 02:10 chenchen1008

@foghina @martinbigio I got the same error.

Some observations:

  1. 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

  2. name collision detected error after doing react-native start.

I took master branch for generating the new project(changed the cli for this).

chirag04 avatar Oct 21 '15 17:10 chirag04

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)

corymsmith avatar Oct 21 '15 20:10 corymsmith

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)

abezhinaru avatar Oct 21 '15 22:10 abezhinaru

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

mountainfirefly avatar Oct 22 '15 09:10 mountainfirefly

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

martinbigio avatar Oct 22 '15 23:10 martinbigio

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 avatar Oct 22 '15 23:10 martinbigio

@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 avatar Oct 22 '15 23:10 ide

@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 avatar Oct 22 '15 23:10 skevy

@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?

ide avatar Oct 23 '15 00:10 ide

Wait, what? I don't think I said that. I'm confused by your response.

skevy avatar Oct 23 '15 00:10 skevy

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.

skevy avatar Oct 23 '15 00:10 skevy

Oh i see. I thought you were referring to honoring the "browser" entry in the JSON.

ide avatar Oct 23 '15 00:10 ide

No no...we should have the 'react-native' directive.

skevy avatar Oct 23 '15 01:10 skevy

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 avatar Oct 28 '15 06:10 mangogogos

@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?

townmi avatar Nov 02 '15 10:11 townmi

I have the same issue

montogeek avatar Nov 09 '15 20:11 montogeek

Same problem here. I found a workaround: npm prune && npm i

JeanLebrument avatar Nov 10 '15 16:11 JeanLebrument

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.

jpapillon avatar Nov 10 '15 20:11 jpapillon

Is there a way to exclude a folder from the packaging?

montogeek avatar Nov 12 '15 02:11 montogeek

@jpapillon solution don't works for me

montogeek avatar Nov 12 '15 02:11 montogeek