-
Notifications
You must be signed in to change notification settings - Fork 317
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
node_modules/react-native-navbar/index.js: Unexpected token (98:19) #134
Comments
Well, seems to be related to your Babel version/config. In the navbar I use |
@Kureev I have saw it. It seems difficult. :( |
It's just about changing presets: [{
plugins: [
'transform-class-properties'
]
}, 'stage-0', 'es2015', 'react'] and install corresponding plugins/presets. That's it. |
I think class properties are turned on by default in latest React - I am using them without rc stuff |
Please upgrade your React to latest version as 0.13 is really old and the errors will be gone. Also - @Kureev you are pasting Babel 6 config, React 0.13 was using 5.x - so in your case it won't work. Either upgrade or use 5.x config :) |
@grabbou Thank you, I tried to upgrade RN and occured some other errors. I were connect the author, the author says he will be fix it. |
Hello @Kureev @grabbou I have the same error but cannot manage to fix it. Would you mind helping me out? My file node_modules/react-native-navbar/.babelrc is:
I am getting the following error if I try to update my file
Also @Kureev what do you mean by "and install corresponding plugins/presets."? Thanks so much for your help, I really appreciate it! |
It's working better with the following plugins, but I am now getting a lot of errors such as "a semi colon is required after a class property" npm install babel-preset-stage-0 |
I'm trying to do my best to have a time for fixing it. To be honest, I'd appreciate a PR a lot! Fixing semi colons doesn't sound like a big issue 😃 @grabbou Maybe you have a few mins to help me with it? |
@Taakn, what is react-native version you are using? My guess is that you are not using the most recent version because latest React Native supports class properties by default, see -> https://github.com/facebook/react-native/blob/master/packager/react-packager/.babelrc#L9 The simplest thing for you would've been to upgrade to React 0.17+ (ideally 0.18) and just re-run. Remember to delete all .babelrc files you've made during testing, esp. the one from react-native-navbar folder. If you for some reason cannot upgrade to latest React, put the babelrc file you already created inside react-native-navbar into root of your project (but again, check if your React Native version uses babel 5 or 6 - you can do so by checking out its package.json). If you are not sure how to add custom transformers, search for issues in RN repo, there's been plenty of them back in the day (few months ago there were only few transformers enabled by default) Semicolons are after class properties in master, not sure if that reflects npm. |
I downloaded a demo.(http://startreact.com/themes/native-starter/)
After that. Run the App, I got an error:
How to fix this?
The Version of Packgers are:
The text was updated successfully, but these errors were encountered: