Getting this error after push and clone from bitbucket, previously existing project running fine, after clone from bitbucket did npm install
and .babelrc
file exist in the root directory.
{
"presets": [
"babel-preset-react-native-stage-0/decorator-support"
],
"env": {
"development": {
"plugins": [
"transform-react-jsx-source"
]
}
}
}
Steps tried :
npm install babel-preset-react-native-stage-0 --save
npm install --save-dev [email protected]
But getting same error on the screen.
Screen shot :
I too was getting the same problem while I was trying to run an old react-native project. I am just starting to learn react-native and hence was experimenting with an old project from a colleague.
After reading above answers I finally solved this issue
There were lot of files in the root folder of which two were:
containing following things:
.babelrc
{
"presets": ["react-native"]
}
babel.config.js
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
};
I didn't knew either of them. But I tried following above answers and commented out .babelrc contents like this:
{
// "presets": ["react-native"]
}
Then started the server again and it did run as expected.
For me I solved the Issue to remove the second preset:
"presets": [
"react-native"
]
down in the "plugins"-Section:
{
"presets": ["module:metro-react-native-babel-preset"],
"env": {
"production": {
"plugins": [
"transform-remove-console",
"@babel/plugin-proposal-optional-chaining",
[
"module-resolver",
{
"root": [
"./src"
],
"alias": {
"test": "./test",
"components": "./components",
"config": "./config",
"lib": "./lib"
}
}
]
],
"presets": [
"react-native"
]
}
}
}
Maybe it helps somebody.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With