Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 opened this issue Jul 7, 2018 · 14 comments

Comments

@zhangchenna
Copy link

zhangchenna commented Jul 7, 2018

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
Copy link

me too,
同版本一样的问题

@CodingPapi
Copy link
Contributor

CodingPapi commented Jul 9, 2018

necolas/react-native-web#308
necolas/react-native-web@c56b472
使用的normalizeColor 在新的react-native中被移动到了独立的npm包中

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

@zhangchenna
Copy link
Author

貌似没有动静

@CodingPapi
Copy link
Contributor

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

@zhangchenna
Copy link
Author

zhangchenna commented Jul 10, 2018

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

@DavidNorena
Copy link
Contributor

can you guys please use english ?

@DavidNorena
Copy link
Contributor

any workaround guys ?

@CodingPapi
Copy link
Contributor

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

@zhangchenna
Copy link
Author

Wait for the official update @DavidNorena

@z-android
Copy link

遇到了同样的问题

@zhangchenna
Copy link
Author

zhangchenna commented Jul 16, 2018

@warmhug

@DavidNorena
Copy link
Contributor

@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
Copy link
Contributor

Update:

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

  • Add normalize-css-color package dependency:

    $ yarn add normalize-css-color -D

  • Place this patch at the root directory of your project.

  • Add a postinstall script in your package.json, so the file will get patched everytime you install something:

  "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
Copy link
Author

The problem has been fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants