Skip to content
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

.babelrc changes are not picked up unless you clear packager cache #63

Closed
gaearon opened this issue Sep 17, 2015 · 10 comments
Closed

.babelrc changes are not picked up unless you clear packager cache #63

gaearon opened this issue Sep 17, 2015 · 10 comments

Comments

@gaearon
Copy link
Collaborator

gaearon commented Sep 17, 2015

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.

:-)

@alejomendoza
Copy link

this is such a pain in the ass issue!

@gaearon
Copy link
Collaborator Author

gaearon commented Sep 19, 2015

For now, just don't use .babelrc.
You can provide Babel configuration in Webpack config, like in the examples.

@elliottsj
Copy link
Collaborator

I'll add a note in the README this evening

@elliottsj
Copy link
Collaborator

Added note: 3ad235c

Let's keep this open until it's truly fixed in RN 0.12

@adaojunior
Copy link

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.

@elliottsj
Copy link
Collaborator

@adaojunior Try ./node_modules/react-native/packager/packager.sh start --resetCache

@adaojunior
Copy link

@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.

@gaearon
Copy link
Collaborator Author

gaearon commented Sep 27, 2015

export default Root

Seems like you're missing class: export default class Root.

@adaojunior
Copy link

@gaearon yeah thank you, it's working now :D
that is just 40 minutes of my life that I wont get back lol

elliottsj pushed a commit to elliottsj/react-native-webpack-server that referenced this issue Oct 25, 2015
elliottsj pushed a commit to elliottsj/react-native-webpack-server that referenced this issue Oct 25, 2015
@oliversisson
Copy link

"Please start using --reset-cache instead. We'll deprecate this argument soon."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants