ex-navigator
ex-navigator copied to clipboard
import type * as ExRoute from './ExRoute';
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.
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..
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.
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