.babelrc changes are not picked up unless you clear packager cache
gaearon opened this issue · 10 comments
I don't know enough about Packager but I just found out the hard way that adding .babelrc
and later changing it has zero effect unless you also delete some temp directories.
This comment explains what to do: facebook/react-native#1924 (comment)
I'm not sure whether we should
- do this from code
- wait for RN to do this
- warn about it in README
but I for sure know I spent three hours on this.
:-)
this is such a pain in the ass issue!
For now, just don't use .babelrc
.
You can provide Babel configuration in Webpack config, like in the examples.
I'll add a note in the README this evening
Im running RN 0.12, how do I clear the cache ?
I tried npm start reset-cache
and sh ./node_modules/react-native/packager/packager.sh reset-cache
and still nothing.
I'm on windows.
@adaojunior Try ./node_modules/react-native/packager/packager.sh start --resetCache
@elliottsj I think it may be working because it is taking longer the first time I start the packager and it transform it after, but I'm still getting a Unexpected Error
, I'm trying to use es6.modules.
export default Root extends React.Component{
render(){
return (
<Text>Hello World!</Text>
);
}
}
but I'm getting an error in the export line.
export default Root
Seems like you're missing class
: export default class Root
.
@gaearon yeah thank you, it's working now :D
that is just 40 minutes of my life that I wont get back lol
"Please start using --reset-cache
instead. We'll deprecate this argument soon."