{"action":"created","issue":{"url":"https://api.github.com/repos/systemjs/systemjs/issues/1502","repository_url":"https://api.github.com/repos/systemjs/systemjs","labels_url":"https://api.github.com/repos/systemjs/systemjs/issues/1502/labels{/name}","comments_url":"https://api.github.com/repos/systemjs/systemjs/issues/1502/comments","events_url":"https://api.github.com/repos/systemjs/systemjs/issues/1502/events","html_url":"https://github.com/systemjs/systemjs/issues/1502","id":191528738,"number":1502,"title":"Inter format dependency import not working","user":{"login":"SamVerschueren","id":1913805,"avatar_url":"https://avatars.githubusercontent.com/u/1913805?v=3","gravatar_id":"","url":"https://api.github.com/users/SamVerschueren","html_url":"https://github.com/SamVerschueren","followers_url":"https://api.github.com/users/SamVerschueren/followers","following_url":"https://api.github.com/users/SamVerschueren/following{/other_user}","gists_url":"https://api.github.com/users/SamVerschueren/gists{/gist_id}","starred_url":"https://api.github.com/users/SamVerschueren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamVerschueren/subscriptions","organizations_url":"https://api.github.com/users/SamVerschueren/orgs","repos_url":"https://api.github.com/users/SamVerschueren/repos","events_url":"https://api.github.com/users/SamVerschueren/events{/privacy}","received_events_url":"https://api.github.com/users/SamVerschueren/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-11-24T14:08:43Z","updated_at":"2016-11-26T19:11:27Z","closed_at":null,"body":"I'm working on an Angular2 application and was using the `import * as x from 'x';` format to import NPM dependencies. That worked, but it failed when I wanted to use Rollup to treeshake my bundle. So I had to switch to `import x from 'x';`. That works when I produce my production bundle. But when I want to start my devserver, it fails because it can't find `x.default`.\r\n\r\nSo I dived into that and came across this https://github.com/systemjs/systemjs/blob/master/docs/module-formats.md#inter-format-dependencies. This means it should be perfectly possible to do that right?\r\n\r\nThis is a stripped down version of my systemjs config\r\n\r\n```json\r\n{\r\n  \"defaultJSExtensions\": true,\r\n  \"packageConfigPaths\": [\r\n    \"/node_modules/@angular/*/package.json\"\r\n  ],\r\n  \"paths\": {\r\n    \"app/*\": \"/app/*\",\r\n    \"@angular/common\": \"node_modules/@angular/common/bundles/common.umd.js\",\r\n    \"@angular/compiler\": \"node_modules/@angular/compiler/bundles/compiler.umd.js\",\r\n    \"@angular/core\": \"node_modules/@angular/core/bundles/core.umd.js\",\r\n    \"@angular/forms\": \"node_modules/@angular/forms/bundles/forms.umd.js\",\r\n    \"@angular/http\": \"node_modules/@angular/http/bundles/http.umd.js\",\r\n    \"@angular/platform-browser\": \"node_modules/@angular/platform-browser/bundles/platform-browser.umd.js\",\r\n    \"@angular/platform-browser-dynamic\": \"node_modules/@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js\",\r\n    \"@angular/router\": \"node_modules/@angular/router/bundles/router.umd.js\",\r\n    \"@angular/common/testing\": \"node_modules/@angular/common/bundles/common-testing.umd.js\",\r\n    \"@angular/compiler/testing\": \"node_modules/@angular/compiler/bundles/compiler-testing.umd.js\",\r\n    \"@angular/core/testing\": \"node_modules/@angular/core/bundles/core-testing.umd.js\",\r\n    \"@angular/http/testing\": \"node_modules/@angular/http/bundles/http-testing.umd.js\",\r\n    \"@angular/platform-browser/testing\": \"node_modules/@angular/platform-browser/bundles/platform-browser-testing.umd.js\",\r\n    \"@angular/platform-browser-dynamic/testing\": \"node_modules/@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js\",\r\n    \"@angular/router/testing\": \"node_modules/@angular/router/bundles/router-testing.umd.js\",\r\n    \"*\": \"node_modules/*\"\r\n  },\r\n  \"packages\": {\r\n    \"rxjs\": {\r\n      \"defaultExtension\": \"js\"\r\n    },\r\n    \"pify\": {\r\n      \"main\": \"index.js\",\r\n      \"format\": \"cjs\"\r\n    }\r\n}\r\n```\r\n\r\nAs you can see, I define `pify` as a CommonJS package. Because they are interoperable, I should be able to write `import pify from 'pify';` instead of `import * as pify from 'pify';`? But I always get the error that `pify.default` is undefined.\r\n\r\nDoes anyone have an idea why it's not working?"},"comment":{"url":"https://api.github.com/repos/systemjs/systemjs/issues/comments/263080373","html_url":"https://github.com/systemjs/systemjs/issues/1502#issuecomment-263080373","issue_url":"https://api.github.com/repos/systemjs/systemjs/issues/1502","id":263080373,"user":{"login":"SamVerschueren","id":1913805,"avatar_url":"https://avatars.githubusercontent.com/u/1913805?v=3","gravatar_id":"","url":"https://api.github.com/users/SamVerschueren","html_url":"https://github.com/SamVerschueren","followers_url":"https://api.github.com/users/SamVerschueren/followers","following_url":"https://api.github.com/users/SamVerschueren/following{/other_user}","gists_url":"https://api.github.com/users/SamVerschueren/gists{/gist_id}","starred_url":"https://api.github.com/users/SamVerschueren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamVerschueren/subscriptions","organizations_url":"https://api.github.com/users/SamVerschueren/orgs","repos_url":"https://api.github.com/users/SamVerschueren/repos","events_url":"https://api.github.com/users/SamVerschueren/events{/privacy}","received_events_url":"https://api.github.com/users/SamVerschueren/received_events","type":"User","site_admin":false},"created_at":"2016-11-26T19:11:27Z","updated_at":"2016-11-26T19:11:27Z","body":"`__moduleName` seems to fix it. Makes me wonder why it's not `module.id` though? Any reason this is different?"}}
{"actor":{"display_login":"SamVerschueren"}}