es6 syntax not working in Meteor 1.2?

Hi guys,

I have just upgraded to Meteor 1.2, and started using es6 syntax, but when I start the app, Meteor keeps complaining about every single piece of es6 usage.

Just one example:

W20151218-12:21:19.129(0)? (STDERR)
W20151218-12:21:19.129(0)? (STDERR) C:\NodeApps\systools\.meteor\local\build\programs\server\app\server\startup.js:4
W20151218-12:21:19.129(0)? (STDERR)   let tail = new Tail(fullpath, '\n', tailOpts);
W20151218-12:21:19.130(0)? (STDERR)       ^^^^
W20151218-12:21:19.130(0)? (STDERR) SyntaxError: Unexpected identifier
W20151218-12:21:19.130(0)? (STDERR)     at C:\NodeApps\systools\.meteor\local\build\programs\server\boot.js:241:30
W20151218-12:21:19.130(0)? (STDERR)     at Array.forEach (native)
W20151218-12:21:19.130(0)? (STDERR)     at Function._.each._.forEach (C:\Meteor\packages\meteor-tool\1.1.10\mt-os.window
s.x86_32\dev_bundle\server-lib\node_modules\underscore\underscore.js:79:11)
W20151218-12:21:19.130(0)? (STDERR)     at C:\NodeApps\systools\.meteor\local\build\programs\server\boot.js:137:5
=> Exited with code: 8
=> Your application is crashing. Waiting for file change.

if I change that let to var, it’s fine with that line, and instead moves on to the next use of es6, which is a backtick for string interpolation:

W20151218-12:25:36.952(0)? (STDERR) C:\NodeApps\systools\.meteor\local\build\programs\server\app\server\startup.js:7
W20151218-12:25:36.952(0)? (STDERR)   console.info(`Watching file ${filename}`);
W20151218-12:25:36.953(0)? (STDERR)                ^
W20151218-12:25:36.953(0)? (STDERR) SyntaxError: Unexpected token ILLEGAL
W20151218-12:25:36.953(0)? (STDERR)     at C:\NodeApps\systools\.meteor\local\build\programs\server\boot.js:241:30
W20151218-12:25:36.953(0)? (STDERR)     at Array.forEach (native)
W20151218-12:25:36.953(0)? (STDERR)     at Function._.each._.forEach (C:\Meteor\packages\meteor-tool\1.1.10\mt-os.window
s.x86_32\dev_bundle\server-lib\node_modules\underscore\underscore.js:79:11)
W20151218-12:25:36.953(0)? (STDERR)     at C:\NodeApps\systools\.meteor\local\build\programs\server\boot.js:137:5

So looks like I’m not supposed to use es6 stuff for some reason?

have you done meteor add ecmascript?

1 Like

I have not. I thought that happens automatically when updating meteor?

Edit:
Works fine now, thanks.