ant-design / ant-design-mobile-rn

Ant Design for React Native
https://rn.mobile.ant.design/
MIT License
3.05k stars 611 forks source link

Failed to load bundle(http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false) with error:(Unable to resolve module `react-native/Libraries/StyleSheet/normalizeColor` from `/Volumes/WORK/react-native-app/node_modules/antd-mobile-rn/lib/segmented-control/segmented.android.js`: Module `react-native/Libraries/StyleSheet/normalizeColor` does not exist in the Haste module map #56

Closed zhangchenna closed 6 years ago

zhangchenna commented 6 years ago

Failed to load bundle(http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false) with error:(Unable to resolve module react-native/Libraries/StyleSheet/normalizeColor from /Volumes/WORK/react-native-app/node_modules/antd-mobile-rn/lib/segmented-control/segmented.android.js: Module react-native/Libraries/StyleSheet/normalizeColor does not exist in the Haste module map

RN 56 ANTUI 2.20版本 react 16.4.1

jianggaocheng commented 6 years ago

me too, 同版本一样的问题

CodingPapi commented 6 years ago

https://github.com/necolas/react-native-web/issues/308 https://github.com/necolas/react-native-web/commit/c56b472258acee7d5bfa8b0fcd485e9b383fc897 使用的normalizeColor 在新的react-native中被移动到了独立的npm包中

能紧急发个包修复这个问题吗?谢谢

zhangchenna commented 6 years ago

貌似没有动静

CodingPapi commented 6 years ago

@zhangchenna 不要引用和使用SegmentedControl控件,可以编译通过,暂时只能这样了

zhangchenna commented 6 years ago

@CodingPapi 看来大家都没有更新新版本吧,这么致命的问题都没人关注 RN 感觉药丸了

DavidNorena commented 6 years ago

can you guys please use english ?

DavidNorena commented 6 years ago

any workaround guys ?

CodingPapi commented 6 years ago

@DavidNorena SegmentedControl will crash on 0.56.0, The workaround is do not import or use it.

zhangchenna commented 6 years ago

Wait for the official update @DavidNorena

z-android commented 6 years ago

遇到了同样的问题

zhangchenna commented 6 years ago

@warmhug

DavidNorena commented 6 years ago

@zhangchenna @z-android for now just make a diff from here, thanks to @CodingPapi ! It's a good workaround until an official update.

Note: It doesn't matter if you don't import SegmentedControl, at least for me it's crashing the whole app, without using it !

DavidNorena commented 6 years ago

Update:

A better workaround for now: (Thanks to @CodingPapi):

  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest",
    "postinstall": "patch -p0 < segmented.android.js.patch"
  },

Note: You should change the patch command if you are working on windows.

zhangchenna commented 6 years ago

The problem has been fixed