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

Unexpected token #60

Closed
jellyfang opened this issue Dec 10, 2015 · 10 comments
Closed

Unexpected token #60

jellyfang opened this issue Dec 10, 2015 · 10 comments

Comments

@jellyfang
Copy link

Using react-native-router-flux and getting this error on build

uncaught error Error: SyntaxError: /.../node_modules/@exponent/react-native-navigator/ExNavigator.js: Unexpected token (24:16)
  22 | 
  23 | export default class ExNavigator extends React.Component {
> 24 |   static Styles = ExNavigatorStyles;
     |                 ^
  25 |   static SceneConfigs = ExSceneConfigs;
  26 |   static Icons = ExNavigatorIcons;
  27 | 
@ide
Copy link
Member

ide commented Dec 10, 2015

You need to enable the "ES7 class properties" feature. Depending on if you are using Babel 5 or Babel 6, the way to do this is different but you should be able to find how to do this on Google or someone on Stack Overflow will be probably be able to answer.

@robtg4
Copy link

robtg4 commented Dec 21, 2015

Was this ever solved? @ide your answer is incomplete

@ide
Copy link
Member

ide commented Dec 21, 2015

You need to enable class properties syntax -- how you do that is dependent on your build process.

@robtg4
Copy link

robtg4 commented Dec 21, 2015

How do you do it via npm install build process - I'm just in a normal react native init build

@ide
Copy link
Member

ide commented Dec 21, 2015

RN 0.17+ supports class properties by default so it should just work for you. Otherwise you'll need to go into the packager (there's a file called transformer.js) and configure it accordingly.

@robtg4
Copy link

robtg4 commented Dec 21, 2015

Is there a way to update to that with the project already created?

@ide
Copy link
Member

ide commented Dec 21, 2015

The most reliable way is to create a new project. There's an upgrade script but it doesn't always work that well.

@robtg4
Copy link

robtg4 commented Dec 21, 2015

will creating a new project automatically get me to 0.17 and not 0.14

@ide
Copy link
Member

ide commented Dec 21, 2015

Yes it will. Could you please use Stack Overflow for general questions about React Native? We would like to keep the issue tracker on this repo focused on ExNavigator bugs and features.

@robtg4
Copy link

robtg4 commented Dec 21, 2015

yep sure thing

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

3 participants