{"action":"created","issue":{"url":"https://api.github.com/repos/systemjs/systemjs/issues/821","labels_url":"https://api.github.com/repos/systemjs/systemjs/issues/821/labels{/name}","comments_url":"https://api.github.com/repos/systemjs/systemjs/issues/821/comments","events_url":"https://api.github.com/repos/systemjs/systemjs/issues/821/events","html_url":"https://github.com/systemjs/systemjs/issues/821","id":109836093,"number":821,"title":"jsdom execution support","user":{"login":"dmatteo","id":4091059,"avatar_url":"https://avatars.githubusercontent.com/u/4091059?v=3","gravatar_id":"","url":"https://api.github.com/users/dmatteo","html_url":"https://github.com/dmatteo","followers_url":"https://api.github.com/users/dmatteo/followers","following_url":"https://api.github.com/users/dmatteo/following{/other_user}","gists_url":"https://api.github.com/users/dmatteo/gists{/gist_id}","starred_url":"https://api.github.com/users/dmatteo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmatteo/subscriptions","organizations_url":"https://api.github.com/users/dmatteo/orgs","repos_url":"https://api.github.com/users/dmatteo/repos","events_url":"https://api.github.com/users/dmatteo/events{/privacy}","received_events_url":"https://api.github.com/users/dmatteo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/systemjs/systemjs/labels/bug","name":"bug","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-10-05T16:26:06Z","updated_at":"2015-10-06T12:50:26Z","closed_at":null,"body":"I'm running SystemJS in node, as part of an effort of migrating all our codebase from RequireJS to SystemJS\r\n\r\nI have a working jsdom instance created with \r\n```javascript\r\n    jsdomify = require('jsdomify');\r\n    jsdomify.create();\r\n```\r\n\r\nAnd I'm including System and configuring accordingly\r\n```javascript\r\n    System = require('systemjs');\r\n    System.config({baseURL: 'file://' + process.cwd() + \"/app/assets/javascripts\"});\r\n    require('../../../config.js');\r\n```\r\n\r\nHowever I get a nasty error when I try to import an AMD module (CommonJS works fine)\r\n```javascript\r\n  it('should load jquery', () => {\r\n    return System.import('jquery').then((module) => {\r\n      return expect(module, 'to be defined');\r\n    })\r\n  });\r\n```\r\n\r\nAnd this is the aforementioned error:\r\n```\r\nAMD module file:///Users/domo/projects/podio/frontend-rails/app/assets/javascripts/jspm_packages/github/components/jquery@2.1.3.js did not define\r\nError loading file:///Users/domo/projects/podio/frontend-rails/app/assets/javascripts/jspm_packages/github/components/jquery@2.1.3.js\r\n```\r\n\r\nFYI, `jquery@2.1.3.js' goes like this (any other AMD module I tried has the same behaviour though):\r\n```javascript\r\ndefine([\"github:components/jquery@2.1.3/jquery\"], function(main) {\r\n  return main;\r\n});\r\n```\r\n\r\nLooking forward to understand what's going on.\r\nCheers!"},"comment":{"url":"https://api.github.com/repos/systemjs/systemjs/issues/comments/145847184","html_url":"https://github.com/systemjs/systemjs/issues/821#issuecomment-145847184","issue_url":"https://api.github.com/repos/systemjs/systemjs/issues/821","id":145847184,"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-10-06T12:50:26Z","updated_at":"2015-10-06T12:50:26Z","body":":+1:\r\n\r\nNote that the issue with `new Function` execution is that free globals are not assigned to the `window`, which is why we needed that. These cases may still crop up in global executions, but may not be an issue either."}}