nx-react-native
nx-react-native copied to clipboard
iOS fails to run on apps generated using 12.5.0
There is an issue with the latest version of this package (which is using a release candidate version of react-native
) which causes run-ios
to fail with the following error:
/Users/xxx/www/sandbox/nx-react-native-test/node_modules/metro-hermes-compiler/src/emhermesc.js:77
throw ex;
^
RuntimeError: abort(TypeError: Cannot read property 'toUpperCase' of undefined). Build with -s ASSERTIONS=1 for more info.
at process.abort (/Users/xxx/www/sandbox/nx-react-native-test/node_modules/metro-hermes-compiler/src/emhermesc.js:440:13)
at process.emit (events.js:375:28)
at processPromiseRejections (internal/process/promises.js:245:33)
at processTicksAndRejections (internal/process/task_queues.js:96:32)
I managed to fix this by installing the previous version (12.3.6
) and generating the app using that. Bumping the version up to 12.5.0
afterwards causes no issues.
I'm not entirely sure what is causing this issue (although I imagine it might be the version of react-native
), but thought I'd raise this issue and offer a solution as it was a struggle getting this to work out of the box.
TLDR for people looking for a quick fix: Generate your app using 12.3.6
. You can bump the version afterwards if you like.
are you using yarn? you might need to add in package.json:
"resolutions": {
"metro": "0.66.0"
}
basically, @react-native-community/cli has dependency of metro “^0.66.0”, which installs 0.66.1