{"action":"created","issue":{"url":"https://api.github.com/repos/jspm/jspm-cli/issues/736","labels_url":"https://api.github.com/repos/jspm/jspm-cli/issues/736/labels{/name}","comments_url":"https://api.github.com/repos/jspm/jspm-cli/issues/736/comments","events_url":"https://api.github.com/repos/jspm/jspm-cli/issues/736/events","html_url":"https://github.com/jspm/jspm-cli/issues/736","id":73515731,"number":736,"title":"import destructuring not working with cjs module","user":{"login":"falafel99","id":7456333,"avatar_url":"https://avatars.githubusercontent.com/u/7456333?v=3","gravatar_id":"","url":"https://api.github.com/users/falafel99","html_url":"https://github.com/falafel99","followers_url":"https://api.github.com/users/falafel99/followers","following_url":"https://api.github.com/users/falafel99/following{/other_user}","gists_url":"https://api.github.com/users/falafel99/gists{/gist_id}","starred_url":"https://api.github.com/users/falafel99/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/falafel99/subscriptions","organizations_url":"https://api.github.com/users/falafel99/orgs","repos_url":"https://api.github.com/users/falafel99/repos","events_url":"https://api.github.com/users/falafel99/events{/privacy}","received_events_url":"https://api.github.com/users/falafel99/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-06T05:01:50Z","updated_at":"2015-05-06T06:36:28Z","closed_at":null,"body":"I have a `baz` cjs module that exports an object with functions. With jspm this won't work:\r\n\r\n```javascript\r\nimport {foo} from 'baz'\r\nconsole.log(foo) // undefined\r\n```\r\n\r\nWhile this does:\r\n\r\n```javascript\r\nimport baz from 'baz'\r\nvar {foo} = baz\r\nconsole.log(foo) // [function]\r\n```\r\n\r\nI am using Babel with jspm to test the code above, but if I use Babel alone (without jspm) then it works fine.\r\n\r\n Any ideas?"},"comment":{"url":"https://api.github.com/repos/jspm/jspm-cli/issues/comments/99343377","html_url":"https://github.com/jspm/jspm-cli/issues/736#issuecomment-99343377","issue_url":"https://api.github.com/repos/jspm/jspm-cli/issues/736","id":99343377,"user":{"login":"OrKoN","id":399150,"avatar_url":"https://avatars.githubusercontent.com/u/399150?v=3","gravatar_id":"","url":"https://api.github.com/users/OrKoN","html_url":"https://github.com/OrKoN","followers_url":"https://api.github.com/users/OrKoN/followers","following_url":"https://api.github.com/users/OrKoN/following{/other_user}","gists_url":"https://api.github.com/users/OrKoN/gists{/gist_id}","starred_url":"https://api.github.com/users/OrKoN/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OrKoN/subscriptions","organizations_url":"https://api.github.com/users/OrKoN/orgs","repos_url":"https://api.github.com/users/OrKoN/repos","events_url":"https://api.github.com/users/OrKoN/events{/privacy}","received_events_url":"https://api.github.com/users/OrKoN/received_events","type":"User","site_admin":false},"created_at":"2015-05-06T06:36:28Z","updated_at":"2015-05-06T06:36:28Z","body":"`import {foo} from 'baz'` is a named import. It means that baz has to `export var foo` in order for this to work. But it seems it acts as a default export (`export default baz`) because it's cjs module. I may be mistaken but I think in the case of `import {foo} from 'baz'` not destructuring happens at all and therefore it does not work. "}}