[TIMOB-26279] ES6 transpile not working
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | None |
| Status | Resolved |
| Resolution | Not Our Bug |
| Resolution Date | 2018-08-10T08:51:56.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | Tooling |
| Labels | n/a |
| Reporter | Jason Kneen |
| Assignee | Unknown |
| Created | 2018-08-09T15:52:53.000+0000 |
| Updated | 2018-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
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
Same here, I was able to compile it successfully. You can check your alloy version with
alloy -vto confirm.That was the issue. I just downgraded Alloy to 1.8 and get the same error. Using latest again resolves the issue immediately.
Yep, unfortunately an error between screen and keyboard -- I was using the Titanium CLI so of course no bundled Alloy -- doh!