learnyoureact icon indicating copy to clipboard operation
learnyoureact copied to clipboard

Not working with babbel 6.5

Open davetoxa opened this issue 9 years ago • 4 comments

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

davetoxa avatar Feb 26 '16 13:02 davetoxa

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 avatar Feb 27 '16 04:02 kohei-takata

@kohei-takata I'am newbie at babel, es6, es7, so can't do it =(

davetoxa avatar Feb 28 '16 18:02 davetoxa

@davetoxa OK, I'll update! Thanks!

kohei-takata avatar Feb 29 '16 23:02 kohei-takata

require('babel-core/register')({ presets: ['es2015', 'react'] });

instead of babel/register

tttimur avatar Aug 05 '16 00:08 tttimur