facebookarchive / react-meteor

React rendering for Meteor apps
948 stars 114 forks source link

Using ES6 `let` keyword breaks `meteor build`. #91

Open nicksergeant opened 9 years ago

nicksergeant commented 9 years ago

I'm not entirely sure what part of the stack might be causing this, but https://github.com/grigio/meteor-babel doesn't seem to have this issue:

When using the let keyword in a .jsx file, running a meteor build breaks on the minification step:

let name = 'whatever';
> meteor build ../sif --server http://thing.com:80
=> Babel active on file extensions: es6.js.  \
Error while building for mobile platforms: Unexpected token: name (channel) (line: 22,
col: 8, pos: 328)

Error
at new JS_Parse_Error
(/Users/Nick/.meteor/packages/meteor-tool/.1.1.3.11ihb8w++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/isopackets/minifiers/npm/minifiers/node_modules/uglify-js/lib/parse.js:196:18)

Strangely, if you use the same code in a .es6.js file (compiling with Babel), this does not break the build step.

Any ideas where to look from here?

rbutera commented 9 years ago

+1

jedwards1211 commented 8 years ago

Use Webpack to build your frontend instead :)