My react native code was working fine till yesterday, but today while I was trying to compile the code I am getting this strange error.
node /Users/aragorn/relay-react-native-app/node_modules/react-native/local-cli/cli.js bundle --entry-file index.ios.js --platform ios --dev true --reset-cache --bundle-output check.js
[04/23/2017, 18:48:40] <START> Initializing Packager
[04/23/2017, 18:48:49] <START> Building Haste Map
[04/23/2017, 18:48:50] <END> Building Haste Map (751ms)
[04/23/2017, 18:48:50] <END> Initializing Packager (9888ms)
[04/23/2017, 18:48:50] <START> Transforming files
Warning: The transform cache was reset.
TransformError: /Users/aragorn/relay-react-native-app/index.ios.js: Unexpected token import.
Following is my .babelrc file which I add because I need to add because I am using relay with react-native.
{
"passPerPreset": true,
"presets": [
{
"plugins": [
"./plugins/babelRelayPlugin"
]
},
"react-native"
]
}
I am struggling with this for quite some time. Can someone please help?
Also, I have added all babel depedencies in my package.json:-
"devDependencies": {
"babel-jest": "18.0.0",
"babel-preset-react-native": "1.9.1",
"babel-cli": "6.18.0",
"babel-core": "6.21.0",
"babel-relay-plugin": "0.10.0",
"jest": "18.0.0",
"react-test-renderer": "15.4.1",
"babel-eslint": "7.1.1",
"eslint": "3.13.1",
"eslint-config-eslint": "3.0.0",
"eslint-friendly-formatter": "2.0.7",
"eslint-loader": "1.6.1",
"eslint-plugin-import": "2.2.0",
"eslint-plugin-jsx-a11y": "3.0.2",
"eslint-plugin-react": "6.9.0"
},