tuckerconnelly / carbon-ui

React Native Material Design library for all platforms
MIT License
210 stars 17 forks source link

Duplicate Haste modules while trying to use local modules for development #18

Closed mattferrin closed 7 years ago

mattferrin commented 7 years ago

(Can't open issue on tuckerconnelly/react-native-web, but will on necolas/react-native-web if I should be using his instead.)

Current state of React Native project's package.json:

{
  "name": "tough",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "carbon-ui": "file://carbon-ui",
    "ramda": "^0.23.0",
    "react": "^15.3.2",
    "react-dom": "^15.3.2",
    "react-native": "^0.37.0",
    "react-native-universal": "file://react-native-universal",
    "react-native-web": "file://react-native-web",
    "react-redux": "^5.0.2",
    "redux": "^3.6.0"
  },
  "devDependencies": {
    "babel-jest": "18.0.0",
    "babel-preset-react-native": "1.9.1",
    "jest": "18.1.0",
    "react-test-renderer": "~15.4.0-rc.4"
  },
  "jest": {
    "preset": "react-native"
  }
}

Failed to build DependencyGraph: @providesModule naming collision: Duplicate module name: ListViewDataSource Paths: /Users/zzz/tough/node_modules/react-native/Libraries/CustomComponents/ListView/ListViewDataSource.js collides with /Users/zzz/tough/react-native-web/src/components/ListView/ListViewDataSource.js

This error is caused by a @providesModule declaration with the same name across two different files. Error: @providesModule naming collision: Duplicate module name: ListViewDataSource Paths: /Users/zzz/tough/node_modules/react-native/Libraries/CustomComponents/ListView/ListViewDataSource.js collides with /Users/zzz/tough/react-native-web/src/components/ListView/ListViewDataSource.js

This error is caused by a @providesModule declaration with the same name across two different files. at HasteMap._updateHasteMap (/Users/zzz/tough/node_modules/react-native/packager/react-packager/src/node-haste/DependencyGraph/HasteMap.js:159:13) at module.getName.then.name (/Users/zzz/tough/node_modules/react-native/packager/react-packager/src/node-haste/DependencyGraph/HasteMap.js:119:31) ~ Process terminated. Press to close the window

tuckerconnelly commented 7 years ago

I use wml for development instead of local modules: https://github.com/wix/wml

And if you're on carbon-ui#master, you should be able to use necolas/react-native-web and get rid of react-native-universal (using webpack alias instead).

Try those out and lemme know how it goes.

mattferrin commented 7 years ago

Thank you for pointing me in the right direction. A lot of motivation and hoping that wml thing works, as soon as I have more time to fight it again :) I'm using git submodules, which might be a mistake, but seemed intuitive.

mattferrin commented 7 years ago

It went great. Finally had time to get it going on iOS and fully expect the other platforms to work, after I finish importing fonts again because I restarted from scratch :) I had icons working in web, and will get that far again soon I hope. Thanks.

tuckerconnelly commented 7 years ago

@mattferrin Np :) And yeah I just refreshed the react-stack-nav-examples with the latest libraries, which work on all platforms. Might wanna check 'em out: https://github.com/tuckerconnelly/react-stack-nav-examples