{"action":"created","issue":{"url":"https://api.github.com/repos/ember-cli/ember-cli/issues/3174","labels_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/3174/labels{/name}","comments_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/3174/comments","events_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/3174/events","html_url":"https://github.com/ember-cli/ember-cli/issues/3174","id":56161307,"number":3174,"title":"Using es6 syntax in an ember-cli (v0.1.12) addon breaks builds and prevents tests from running","user":{"login":"poteto","id":1390709,"avatar_url":"https://avatars.githubusercontent.com/u/1390709?v=3","gravatar_id":"","url":"https://api.github.com/users/poteto","html_url":"https://github.com/poteto","followers_url":"https://api.github.com/users/poteto/followers","following_url":"https://api.github.com/users/poteto/following{/other_user}","gists_url":"https://api.github.com/users/poteto/gists{/gist_id}","starred_url":"https://api.github.com/users/poteto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poteto/subscriptions","organizations_url":"https://api.github.com/users/poteto/orgs","repos_url":"https://api.github.com/users/poteto/repos","events_url":"https://api.github.com/users/poteto/events{/privacy}","received_events_url":"https://api.github.com/users/poteto/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ember-cli/ember-cli/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-01T11:56:46Z","updated_at":"2015-02-01T13:22:39Z","closed_at":null,"body":"I'm building an `ember-cli` addon with `v0.1.12`, and encountered problems when I use es6 syntax.\r\n\r\nAs a test, I initialized a new empty `ember-addon`, and added one component in `components/component-name.js`. No other changes were made.\r\n\r\n- When using destructuring and es6 syntax in my component:\r\n\r\n```javascript\r\nimport Ember from 'ember';\r\n\r\nvar { computed, get } = Ember.computed;\r\n\r\nexport default Ember.Component.extend({\r\n  // es6 syntax used here \r\n});\r\n```\r\n\r\nI get this error:\r\n\r\n```javascript\r\nversion: 0.1.12\r\nBuild failed.\r\nFile: testymctest/components/flash-message\r\nUnexpected token (3:20)\r\nSyntaxError: Unexpected token (3:20)\r\n    at raise (/Users/lauren/Code/testymctest/node_modules/ember-cli/node_modules/broccoli-es6modules/node_modules/esperanto/node_modules/acorn/acorn.js:333:15)\r\n    at unexpected (/Users/lauren/Code/testymctest/node_modules/ember-cli/node_modules/broccoli-es6modules/node_modules/esperanto/node_modules/acorn/acorn.js:1366:5)\r\n    at parseIdent (/Users/lauren/Code/testymctest/node_modules/ember-cli/node_modules/broccoli-es6modules/node_modules/esperanto/node_modules/acorn/acorn.js:2471:7)\r\n    at parsePropertyName (/Users/lauren/Code/testymctest/node_modules/ember-cli/node_modules/broccoli-es6modules/node_modules/esperanto/node_modules/acorn/acorn.js:2250:78)\r\n    at parseObj (/Users/lauren/Code/testymctest/node_modules/ember-cli/node_modules/broccoli-es6modules/node_modules/esperanto/node_modules/acorn/acorn.js:2225:9)\r\n    at parseExprAtom (/Users/lauren/Code/testymctest/node_modules/ember-cli/node_modules/broccoli-es6modules/node_modules/esperanto/node_modules/acorn/acorn.js:2136:14)\r\n    at parseVar (/Users/lauren/Code/testymctest/node_modules/ember-cli/node_modules/broccoli-es6modules/node_modules/esperanto/node_modules/acorn/acorn.js:1875:57)\r\n    at parseVarStatement (/Users/lauren/Code/testymctest/node_modules/ember-cli/node_modules/broccoli-es6modules/node_modules/esperanto/node_modules/acorn/acorn.js:1763:5)\r\n    at parseStatement (/Users/lauren/Code/testymctest/node_modules/ember-cli/node_modules/broccoli-es6modules/node_modules/esperanto/node_modules/acorn/acorn.js:1569:47)\r\n    at parseTopLevel (/Users/lauren/Code/testymctest/node_modules/ember-cli/node_modules/broccoli-es6modules/node_modules/esperanto/node_modules/acorn/acorn.js:1526:18)\r\n```\r\n\r\n- When I don't use destructuring and use es6 syntax in my component, it builds successfully, but hangs and eventually timeouts:\r\n\r\n```javascript\r\nversion: 0.1.12\r\nBuilt project successfully. Stored in \"/Users/lauren/Code/testymctest/tmp/class-tests_dist-fxkpe8Zs.tmp\".\r\n```\r\n\r\n- When running `ember test -s` with es6 syntax:\r\n\r\n![screenshot 2015-02-01 22 58 09](https://cloud.githubusercontent.com/assets/1390709/5991989/df7b71a6-aa65-11e4-8ac1-5c13c0e21977.png)\r\n\r\n- But when I switch over to plain es5:\r\n\r\n```javascript\r\n\r\nimport Ember from 'ember';\r\n\r\nvar computed = Ember.computed;\r\nvar get      = Ember.get;\r\n\r\nexport default Ember.Component.extend({\r\n  // es5 syntax\r\n});\r\n```\r\n\r\nIt builds and tests run fine with no es6.\r\n\r\nAgain, this was tested with a blank addon and only one component file in `addon/components/flash-message.js`."},"comment":{"url":"https://api.github.com/repos/ember-cli/ember-cli/issues/comments/72364530","html_url":"https://github.com/ember-cli/ember-cli/issues/3174#issuecomment-72364530","issue_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/3174","id":72364530,"user":{"login":"rwjblue","id":12637,"avatar_url":"https://avatars.githubusercontent.com/u/12637?v=3","gravatar_id":"","url":"https://api.github.com/users/rwjblue","html_url":"https://github.com/rwjblue","followers_url":"https://api.github.com/users/rwjblue/followers","following_url":"https://api.github.com/users/rwjblue/following{/other_user}","gists_url":"https://api.github.com/users/rwjblue/gists{/gist_id}","starred_url":"https://api.github.com/users/rwjblue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwjblue/subscriptions","organizations_url":"https://api.github.com/users/rwjblue/orgs","repos_url":"https://api.github.com/users/rwjblue/repos","events_url":"https://api.github.com/users/rwjblue/events{/privacy}","received_events_url":"https://api.github.com/users/rwjblue/received_events","type":"User","site_admin":false},"created_at":"2015-02-01T13:22:39Z","updated_at":"2015-02-01T13:22:39Z","body":"#3166 addresses the underlying issue.  Currently addons cannot use addons to add preprocessor steps (in this case we need ember-cli-6to5 in the addon to preprocess the JS)."}}