{"action":"created","issue":{"url":"https://api.github.com/repos/riot/riot/issues/1715","repository_url":"https://api.github.com/repos/riot/riot","labels_url":"https://api.github.com/repos/riot/riot/issues/1715/labels{/name}","comments_url":"https://api.github.com/repos/riot/riot/issues/1715/comments","events_url":"https://api.github.com/repos/riot/riot/issues/1715/events","html_url":"https://github.com/riot/riot/issues/1715","id":144861243,"number":1715,"title":"JSPM + Riot.js + import statements in tags","user":{"login":"josephrocca","id":1167575,"avatar_url":"https://avatars.githubusercontent.com/u/1167575?v=3","gravatar_id":"","url":"https://api.github.com/users/josephrocca","html_url":"https://github.com/josephrocca","followers_url":"https://api.github.com/users/josephrocca/followers","following_url":"https://api.github.com/users/josephrocca/following{/other_user}","gists_url":"https://api.github.com/users/josephrocca/gists{/gist_id}","starred_url":"https://api.github.com/users/josephrocca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josephrocca/subscriptions","organizations_url":"https://api.github.com/users/josephrocca/orgs","repos_url":"https://api.github.com/users/josephrocca/repos","events_url":"https://api.github.com/users/josephrocca/events{/privacy}","received_events_url":"https://api.github.com/users/josephrocca/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/riot/riot/labels/question","name":"question","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2016-03-31T10:57:48Z","updated_at":"2016-04-09T16:03:32Z","closed_at":"2016-04-09T16:03:32Z","body":"### Describe your issue:\r\nI'm trying to get riot.js to work with JSPM and it was all going perfect until I put an `import` statement inside the script tag in one of my custom riot tags.\r\n\r\nI get this error: `Uncaught (in promise) Error: SyntaxError: Unexpected token import    system.js:4`\r\n\r\nMy question is: Is this a problem with riot, JSPM, me, or some combination?\r\n\r\nJSPM has been working great for me so far so I don't think that's the problem. I've seen [other examples](https://github.com/GianlucaGuarini/riot-webpack-babel-template) where putting `import` statements inside script tags works fine, so I don't think it's a problem with riot.\r\n\r\nSo maybe there's something simple I'm missing? Someone suggested to install [babel-preset-es2015](https://github.com/babel/babel/tree/master/packages/babel-preset-es2015), but I think JSPM already handles all the babel stuff so that's not relevant to me.\r\n\r\n### Can you reproduce the issue?\r\n\r\nI don't think so unless plunker supports JSPM. I made an example of what I'm trying to do in any case:\r\nhttp://plnkr.co/edit/80FlhIABVnfTv7mops2I?p=preview\r\n\r\n**EDIT**: I made a repo showing the problem: https://github.com/josephrocca/riot-jspm/tree/import_in_tag_test\r\n\r\nJust need to call `npm install` and then `jspm install` and it's good to go.\r\n\r\n### On which browser/OS does the issue appear?\r\nChrome, Windows\r\n\r\n### Which version of Riot does it affect?\r\n2.3.17\r\n\r\n### How would you tag this issue?\r\n\r\n  - [x] Question\r\n  - [ ] Bug\r\n  - [ ] Discussion\r\n  - [ ] Feature request\r\n  - [ ] Tip\r\n  - [ ] Enhancement\r\n  - [ ] Performance\r\n"},"comment":{"url":"https://api.github.com/repos/riot/riot/issues/comments/207812928","html_url":"https://github.com/riot/riot/issues/1715#issuecomment-207812928","issue_url":"https://api.github.com/repos/riot/riot/issues/1715","id":207812928,"user":{"login":"GianlucaGuarini","id":879612,"avatar_url":"https://avatars.githubusercontent.com/u/879612?v=3","gravatar_id":"","url":"https://api.github.com/users/GianlucaGuarini","html_url":"https://github.com/GianlucaGuarini","followers_url":"https://api.github.com/users/GianlucaGuarini/followers","following_url":"https://api.github.com/users/GianlucaGuarini/following{/other_user}","gists_url":"https://api.github.com/users/GianlucaGuarini/gists{/gist_id}","starred_url":"https://api.github.com/users/GianlucaGuarini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GianlucaGuarini/subscriptions","organizations_url":"https://api.github.com/users/GianlucaGuarini/orgs","repos_url":"https://api.github.com/users/GianlucaGuarini/repos","events_url":"https://api.github.com/users/GianlucaGuarini/events{/privacy}","received_events_url":"https://api.github.com/users/GianlucaGuarini/received_events","type":"User","site_admin":false},"created_at":"2016-04-09T16:03:32Z","updated_at":"2016-04-09T16:03:32Z","body":"I will close this issue because the es6 modules specs do not allow the import of scripts in nested functions. My workaround is enough to solve the issue"}}