{"action":"created","issue":{"url":"https://api.github.com/repos/6to5/6to5/issues/587","labels_url":"https://api.github.com/repos/6to5/6to5/issues/587/labels{/name}","comments_url":"https://api.github.com/repos/6to5/6to5/issues/587/comments","events_url":"https://api.github.com/repos/6to5/6to5/issues/587/events","html_url":"https://github.com/6to5/6to5/issues/587","id":55392934,"number":587,"title":"Primitive default export causes named exports to be undefined","user":{"login":"UltCombo","id":2090712,"avatar_url":"https://avatars.githubusercontent.com/u/2090712?v=3","gravatar_id":"","url":"https://api.github.com/users/UltCombo","html_url":"https://github.com/UltCombo","followers_url":"https://api.github.com/users/UltCombo/followers","following_url":"https://api.github.com/users/UltCombo/following{/other_user}","gists_url":"https://api.github.com/users/UltCombo/gists{/gist_id}","starred_url":"https://api.github.com/users/UltCombo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UltCombo/subscriptions","organizations_url":"https://api.github.com/users/UltCombo/orgs","repos_url":"https://api.github.com/users/UltCombo/repos","events_url":"https://api.github.com/users/UltCombo/events{/privacy}","received_events_url":"https://api.github.com/users/UltCombo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-01-25T02:33:41Z","updated_at":"2015-01-25T12:30:22Z","closed_at":"2015-01-25T02:40:37Z","body":"## Test case\r\n\r\n**src/x.js**\r\n```js\r\nexport default 'hey';\r\nexport let x = 'x';\r\n```\r\n\r\n**src/index.js**\r\n```js\r\nimport {x} from './x';\r\nconsole.log(x); // should log 'x', but logs `undefined` instead\r\n```\r\n\r\nTo test:\r\n```\r\n6to5 src --out-dir dist && node dist\r\n```\r\n\r\nLooks like this is due to the modules interop approach trying to `_extends()` the `exports[\"default\"]`, which is a primitive and trying to assign to its properties fails silently."},"comment":{"url":"https://api.github.com/repos/6to5/6to5/issues/comments/71370476","html_url":"https://github.com/6to5/6to5/issues/587#issuecomment-71370476","issue_url":"https://api.github.com/repos/6to5/6to5/issues/587","id":71370476,"user":{"login":"guybedford","id":598730,"avatar_url":"https://avatars.githubusercontent.com/u/598730?v=3","gravatar_id":"","url":"https://api.github.com/users/guybedford","html_url":"https://github.com/guybedford","followers_url":"https://api.github.com/users/guybedford/followers","following_url":"https://api.github.com/users/guybedford/following{/other_user}","gists_url":"https://api.github.com/users/guybedford/gists{/gist_id}","starred_url":"https://api.github.com/users/guybedford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guybedford/subscriptions","organizations_url":"https://api.github.com/users/guybedford/orgs","repos_url":"https://api.github.com/users/guybedford/repos","events_url":"https://api.github.com/users/guybedford/events{/privacy}","received_events_url":"https://api.github.com/users/guybedford/received_events","type":"User","site_admin":false},"created_at":"2015-01-25T12:30:22Z","updated_at":"2015-01-25T12:30:22Z","body":"I just checked this output and it looks like:\r\n\r\n```javascript\r\n\"use strict\";\r\n\r\nvar _extends = function (target) {\r\n  for (var i = 1; i < arguments.length; i++) {\r\n    var source = arguments[i];\r\n    for (var key in source) {\r\n      target[key] = source[key];\r\n    }\r\n  }\r\n\r\n  return target;\r\n};\r\n\r\nexports[\"default\"] = \"hey\";\r\nvar x = exports.x = \"x\";\r\nmodule.exports = _extends(exports[\"default\"], exports);\r\n```\r\n\r\nI never knew this had been added? I'd be interested to know why we aren't using the straightforward output here:\r\n\r\n```javascript\r\nexports['default'] = 'hey';\r\nexports['x'] = 'x';\r\n```"}}