Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26279] ES6 transpile not working

GitHub Issuen/a
TypeBug
PriorityNone
StatusResolved
ResolutionNot Our Bug
Resolution Date2018-08-10T08:51:56.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTooling
Labelsn/a
ReporterJason Kneen
AssigneeUnknown
Created2018-08-09T15:52:53.000+0000
Updated2018-08-17T10:47:54.000+0000

Description

Created a new app, added Transpile option to tiapp.xml and some sample ES6 code and when building I get:
[ERROR] Error generating AST for "/Users/jkneen/Documents/Appcelerator_Studio_Workspace/es6/app/controllers/index.js"
[ERROR] Unexpected token: name (i)
[ERROR] line 7, column 4, position 71
[ERROR] Alloy compiler failed
Project: https://www.dropbox.com/s/7e467yjzg4a8m1o/es6.zip?dl=1

Comments

  1. Ewan Harris 2018-08-09

    Hey [~jkneen] can you provide some info on your env? - Are you using titanium or appc? - What's the alloy version you're using? I can compile the attached app just fine using alloy 1.13.1 (latest on npm), 1.12.0 (appc cli 7.0.4). Based off the error message you're probably using a version of alloy from before we switched to babel for parsing js code, which allows the alloy compile process to handle ES6. I think that was around alloy 1.10 timeframe
  2. Hans Knöchel 2018-08-09

    Same here, I was able to compile it successfully. You can check your alloy version with alloy -v to confirm.
  3. Hans Knöchel 2018-08-10

    That was the issue. I just downgraded Alloy to 1.8 and get the same error. Using latest again resolves the issue immediately.
  4. Jason Kneen 2018-08-17

    Yep, unfortunately an error between screen and keyboard -- I was using the Titanium CLI so of course no bundled Alloy -- doh!

JSON Source