React: JSX: Illegal import declaration

Created on 13 Mar 2015  路  4Comments  路  Source: facebook/react

Hi,

I try new react v0.13 and I got Error: Illegal import declaration. It was all right for react v0.12.2. I tried set options harmony to true and false but it doesn't matter.

Code:

import foo from 'path/to/file.js';

var view = React.createClass({
//definition
});

Do you have a some solution?

Thanks.

Most helpful comment

Hi,

I set for my gulp task react({harmony: false, es6module: true}) and everything working right.

Thanks

Thanks

All 4 comments

Hi,

I set for my gulp task react({harmony: false, es6module: true}) and everything working right.

Thanks

Thanks

Sorry, meant to comment the other day. You did figure out the right option (es6module). Sorry about the confusion and lack of docs here.

Hi,

I am happy that it had a solution.

Thanks for yours quick reaction.

Was this page helpful?
0 / 5 - 0 ratings