-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Fix for windows platform dependent modules resolution #3606
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks! If you are contributing on behalf of someone else (eg your employer): the individual CLA is not sufficient - use https://developers.facebook.com/opensource/cla?type=company instead. Contact cla@fb.com if you have any questions. |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
You can configure the "haste" config option to add "platforms" manually:
that should work for you, no? |
to my applications |
@cpojer i've tried that initially, didn't helped me for some reason... But this is something worth having in documentation maybe? UPD: Just tried again having this in package.json: {
"name": "test",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"node-inspector": "^1.1.1",
"react": "16.0.0-alpha.6",
"react-native": "0.44.0",
"react-native-windows": "^0.43.0-rc.0"
},
"devDependencies": {
"babel-jest": "20.0.3",
"babel-preset-react-native": "1.9.2",
"jest": "20.0.3",
"react-test-renderer": "16.0.0-alpha.6"
},
"jest": {
"preset": "react-native",
"haste": {
"defaultPlatform": "ios",
"platforms": [
"android",
"ios",
"native",
"windows"
],
"providesModuleNodeModules": [
"react-native"
]
}
}
}
Got RCTVirtualText Exception patched the getPlatformExtension.js, launched again with the same line Work fine... |
@bd, have you tried to build your app with Release configuration? Is it fine? |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
According to this issue: facebook/react-native#14053 here is the problems with windows platform dependent modules...
Test plan
copy/paste from the referenced issue for convenience:
Description
If react-native and react-native-windows installed together - the modules from latter considered being generic(g) by the packager(jest-haste-map). As result, we have broken app.
the initial discussion was started here: facebook/react-native#13925
Reproduction Steps and Sample Code
Solution
During investigating this, read a lot of code and eventually come to jest-haste-map - the one which required by react-native.
In the react-native packager defaults.js here is platforms array exported, looks like dat:
at the same time, in jest-haste-map's lib/getPlatformExtension.js we have:
adding windows: true, to SUPPORTED_PLATFORM_EXTS dict will give us a fix: