I started ejecting expo, after so much struggle I could able to solve all build issues. When I run the app using 'sudo react-native run-android' I started getting following error
Error:
The development server returned response code 500
Bundling `index.android.js` [development, non-minified, hmr disabled]
0.0% (0/1), failed.
error: bundling failed: "TransformError:
/Development/SourceCode/MobileApp/index.android.js:
Couldn't find preset \"babel-preset-react-native-stage-0/decorator-support\" relative to directory \"/Development/SourceCode/MobileApp\""
I tried almost all possible fixes given in github and SO
- uninstalling latest version of babel-preset-react-native and re-installing sudo yarn add babel-preset-react-native@2.1.0
- Clear cache Yarn Cache, npm cache
- deleting build folder, deleting npm modules and reinstall all modules
- Few people fixed the issue by removing watchman, but I am not using watchman at all.
- Adding .babelrc mentioning decorator-support for preset as follows, this fix also didn't work.
.babelrc
file looks like this
{
"presets": [
"react-native",
"babel-preset-react-native-stage-0/decorator-support"
],
"env": {
"development": {
"plugins": [
"transform-react-jsx-source"
]
}
}
}
None of those fixes worked for me. using babel-preset-react-native@2.1.0
also didn't fix the issue because that was the major fix.