learnyoureact
learnyoureact copied to clipboard
Not working with babbel 6.5
Hello :) I'd tried to upgrade to the latest babbel 6.5.2
And first example not working anymore
SyntaxError: /Users/acherepanov/learnyoureact/views/index.jsx: Unexpected token (5:11)
3 | export default class TodoBox extends React.Component{
4 | render() {
> 5 | return <div className="todoBox">
| ^
6 | Hello, world!
7 | </div>
8 | }
at Parser.pp.raise (/Users/acherepanov/learnyoureact/node_modules/babylon/index.js:1425:13)
at Parser.pp.unexpected (/Users/acherepanov/learnyoureact/node_modules/babylon/index.js:2905:8)
at Parser.pp.parseExprAtom (/Users/acherepanov/learnyoureact/node_modules/babylon/index.js:754:12)
at Parser.pp.parseExprSubscripts (/Users/acherepanov/learnyoureact/node_modules/babylon/index.js:509:19)
at Parser.pp.parseMaybeUnary (/Users/acherepanov/learnyoureact/node_modules/babylon/index.js:489:19)
at Parser.pp.parseExprOps (/Users/acherepanov/learnyoureact/node_modules/babylon/index.js:420:19)
at Parser.pp.parseMaybeConditional (/Users/acherepanov/learnyoureact/node_modules/babylon/index.js:402:19)
at Parser.pp.parseMaybeAssign (/Users/acherepanov/learnyoureact/node_modules/babylon/index.js:365:19)
at Parser.pp.parseExpression (/Users/acherepanov/learnyoureact/node_modules/babylon/index.js:329:19)
at Parser.pp.parseReturnStatement (/Users/acherepanov/learnyoureact/node_modules/babylon/index.js:2106:26)
SyntaxError: /Users/acherepanov/learnyoureact/views/index.jsx: Unexpected token (5:11)
Dependencies:
├── [email protected] extraneous
├── [email protected] extraneous
├── [email protected] extraneous
├── [email protected] extraneous
├── [email protected] extraneous
└── [email protected] extraneous
Hello @davetoxa :) Thanks for your reporting issue. Now, learnyoureact is not supporting Babel v6. But I think it's good for users to use later version of libraries. I'll update learnyoureact for using Babel v6. And Pull Requests are always welcome. If you update learnyoureact, I'll merge :)
@kohei-takata I'am newbie at babel, es6, es7, so can't do it =(
@davetoxa OK, I'll update! Thanks!
require('babel-core/register')({ presets: ['es2015', 'react'] });
instead of babel/register