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

import type * as ExRoute from './ExRoute'; #107

Open
pavlelekic opened this issue Apr 11, 2016 · 3 comments
Open

import type * as ExRoute from './ExRoute'; #107

pavlelekic opened this issue Apr 11, 2016 · 3 comments

Comments

@pavlelekic
Copy link

I'm trying to make a bundle with babel + webpack, and I'm constantly getting this unexpected token error:


ERROR in ./~/@exponent/react-native-navigator/ExNavigator.js
Module parse failed: /Users/Arbor/Desktop/ArborMobileApp/backend/node_modules/@exponent/react-native-navigator/ExNavigator.js Unexpected token (21:12)
You may need an appropriate loader to handle this file type.
| import * as ExNavigatorIcons from './ExNavigatorIcons';
| 
| import type * as ExRoute from './ExRoute';
| 
| export default class ExNavigator extends React.Component {
 @ ./logic/initialize.js 14:175-218

The problem is, I don't know which babel plugin to include in order to solve this problem. Here is my .babelrc file:

{
"presets": ["react-native"],
"plugins": ["transform-class-properties"]
}

I used "babel-preset-react-native" to enable all the es features used by react, and I also added"babel-plugin-transform-class-properties" in order to support static class properties.

Please help! Thanks.

@pavlelekic
Copy link
Author

This "import type *" thing looks like Flow annotations, could you please tell me which babel transforms did you use to bundle and run this code? There is no .babelrc file in this repo so I cannot figure it out by myself, or dependencies set in package.json..

@ide
Copy link
Member

ide commented Apr 11, 2016

That is Flow syntax. Search the Babel site for "flow" or grep the babel code base and I think you'll be pointed in the right direction.

@anupkale1984
Copy link

I was able to resolve it with. Development server restart as mention on this post
https://www.npmjs.com/package/babel-preset-react-native-stage-0

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