Open samsond opened 8 years ago
Hi,
Before you fixed it what where you using in your gulpfile to compile the react template?
For the current version of Babelify the syntax in the book is not supported but there is a quick fix:
1) inside /snapterest do npm install --save-dev babel-preset-react
2) inside /snapterest do npm install --save-dev babel-preset-es2015 babel-preset-react
2) replace:
this :
.transform(babelify)
.transform(babelify)
with this :
.transform(babelify.configure({ presets: ["es2015", "react"] }))
Shout out for wphampton for this ( https://github.com/babel/babelify/issues/126 )
when i tried running gulp i have got the below error, events.js:160 throw er; // Unhandled 'error' event ^
SyntaxError: /Users/samsonhailu/project/sandbox/reactessential/snapterest/source/app.js: Unexpected token (4:18) 2 | var ReactDOM = require('react-dom'); 3 |
but when i compile it using jsx --watch source/ build/ ... it compiles successfully. i didn't know the reason why it failed?