generator-flux-react
generator-flux-react copied to clipboard
Getting browserify error - Unexpected token (4:13) while parsing file: index.jsx
After generating the project and running npm start, I ran into this error
[06:33:12] Browserify Error { [SyntaxError: C:/projects/react/gen-flux-demo/src/js/index.jsx: Unexpected token (4:13) while parsing file: C:\projects\react\gen-flux-demo\src\js\index.jsx]
pos: 99,
loc: Position { line: 4, column: 13 },
_babel: true,
codeFrame: '\u001b[0m 2 | \u001b[36mimport\u001b[39m AppContainer from \u001b[31m\'./components/AppContainer.jsx\'\u001b[39m\u001b[1m;\u001b[22m\n 3 | \n> 4 | React\u001b[1m.\u001b[22mrender\u001b[94m\u001b[1m(\u001b[22m\u001b[39m\u001b[1m<\u001b[22mAppContainer \u001b[1m/\u001b[22m\u001b[1m>\u001b[22m\u001b[1m,\u001b[22m document\u001b[1m.\u001b[22mgetElementById\u001b[94m\u001b[1m(\u001b[22m\u001b[39m\u001b[31m\'main\'\u001b[39m\u001b[94m\u001b[1m)\u001b[22m\u001b[39m\u001b[94m\u001b[1m)\u001b[22m\u001b[39m\u001b[1m;\u001b[22m\n | ^\n 5 | \u001b[0m',
filename: 'C:\\projects\\react\\gen-flux-demo\\src\\js\\index.jsx',
I am getting same error on Linux as well
Any ideas?
Hello, Firstly, thanks for this really good generator!
So, I have the same issue when I try to install the npm package superagent. It is the normal behavior?
Kind regards.
i get the same issue on OS X.
i was able to follow some instructions here: https://github.com/babel/babelify/issues/126
npm install --save-dev babel-preset-es2015
npm install --save-dev babel-preset-react
then edit .babelrc
{
"presets": ["es2015", "react"]
}
:+1: this worked for me thanks @christopherslee
Works for me too. Thanks @christopherslee
Thanks @christopherslee and friends! I just published 0.4.6
which should include this change. Let me know if you run into any issues.
Hi all, I have come across this when I was trying to do something on react with es6. Even I followed the same babel config
{
"presets": [
[
"es2015"
],
"react"
],
"plugins": [
"react-hot-loader/babel"
]
}
However though It didn't work for me. It shows that there is an unexpected token which I found out to be "="