{"action":"opened","issue":{"url":"https://api.github.com/repos/caridy/es6-micro-loader/issues/4","labels_url":"https://api.github.com/repos/caridy/es6-micro-loader/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/caridy/es6-micro-loader/issues/4/comments","events_url":"https://api.github.com/repos/caridy/es6-micro-loader/issues/4/events","html_url":"https://github.com/caridy/es6-micro-loader/issues/4","id":64031850,"number":4,"title":"Top-level promise for System.import not resolved for dynamically loaded files","user":{"login":"pkozlowski-opensource","id":973550,"avatar_url":"https://avatars.githubusercontent.com/u/973550?v=3","gravatar_id":"","url":"https://api.github.com/users/pkozlowski-opensource","html_url":"https://github.com/pkozlowski-opensource","followers_url":"https://api.github.com/users/pkozlowski-opensource/followers","following_url":"https://api.github.com/users/pkozlowski-opensource/following{/other_user}","gists_url":"https://api.github.com/users/pkozlowski-opensource/gists{/gist_id}","starred_url":"https://api.github.com/users/pkozlowski-opensource/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkozlowski-opensource/subscriptions","organizations_url":"https://api.github.com/users/pkozlowski-opensource/orgs","repos_url":"https://api.github.com/users/pkozlowski-opensource/repos","events_url":"https://api.github.com/users/pkozlowski-opensource/events{/privacy}","received_events_url":"https://api.github.com/users/pkozlowski-opensource/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-24T15:52:00Z","updated_at":"2015-03-24T15:52:00Z","closed_at":null,"body":"@caridy I can't send a proper patch atm (will do later today while back at home) but there is a bug in the [System.import](https://github.com/caridy/es6-micro-loader/blob/f25b6e98a1f8a2dc16f8b31fb72d830c2a747703/client.js#L104-L109) handling of promises for dynamically loaded files - please notice how `resolve` is never called when a file is loaded.\r\n\r\nI believe that the proper solution is to do:\r\n\r\n```javascript\r\n    import: function(name) {\r\n        var normalizedName = normalizeName(name, []);\r\n        var mod = get(normalizedName);\r\n        return mod ? Promise.resolve(mod) : load(name).then(function () {\r\n            return get(normalizedName);\r\n        });\r\n    },\r\n```\r\n\r\nDoes it sound reasonable? If so I will try to submit a PR, including tests (I just need to get familiar with the tools / testing strategy this project is using)."}}