{"action":"created","issue":{"url":"https://api.github.com/repos/systemjs/systemjs/issues/753","labels_url":"https://api.github.com/repos/systemjs/systemjs/issues/753/labels{/name}","comments_url":"https://api.github.com/repos/systemjs/systemjs/issues/753/comments","events_url":"https://api.github.com/repos/systemjs/systemjs/issues/753/events","html_url":"https://github.com/systemjs/systemjs/issues/753","id":104343812,"number":753,"title":"Multiple defines for anonymous module","user":{"login":"ryanfitzer","id":384629,"avatar_url":"https://avatars.githubusercontent.com/u/384629?v=3","gravatar_id":"","url":"https://api.github.com/users/ryanfitzer","html_url":"https://github.com/ryanfitzer","followers_url":"https://api.github.com/users/ryanfitzer/followers","following_url":"https://api.github.com/users/ryanfitzer/following{/other_user}","gists_url":"https://api.github.com/users/ryanfitzer/gists{/gist_id}","starred_url":"https://api.github.com/users/ryanfitzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryanfitzer/subscriptions","organizations_url":"https://api.github.com/users/ryanfitzer/orgs","repos_url":"https://api.github.com/users/ryanfitzer/repos","events_url":"https://api.github.com/users/ryanfitzer/events{/privacy}","received_events_url":"https://api.github.com/users/ryanfitzer/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/systemjs/systemjs/labels/support","name":"support","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-01T20:05:34Z","updated_at":"2015-09-02T20:09:46Z","closed_at":null,"body":"I'm converting my [Example-RequireJS-jQuery-Project](https://github.com/ryanfitzer/Example-RequireJS-jQuery-Project) over to JSPM to get a better understanding of how SystemJS handles AMD. Everything works fine when I reassign the `require` and `define` globals:\r\n\r\n```\r\nwindow.define = System.amdDefine;\r\nwindow.require = window.requirejs = System.amdRequire;\r\n```\r\n\r\nAs a test, I tried instead updating all the files to use `System.amdDefine` and `System.amdRequire` directly and get the error: `Multiple defines for anonymous module`. Any ideas on what I'm not understanding?"},"comment":{"url":"https://api.github.com/repos/systemjs/systemjs/issues/comments/137229479","html_url":"https://github.com/systemjs/systemjs/issues/753#issuecomment-137229479","issue_url":"https://api.github.com/repos/systemjs/systemjs/issues/753","id":137229479,"user":{"login":"ryanfitzer","id":384629,"avatar_url":"https://avatars.githubusercontent.com/u/384629?v=3","gravatar_id":"","url":"https://api.github.com/users/ryanfitzer","html_url":"https://github.com/ryanfitzer","followers_url":"https://api.github.com/users/ryanfitzer/followers","following_url":"https://api.github.com/users/ryanfitzer/following{/other_user}","gists_url":"https://api.github.com/users/ryanfitzer/gists{/gist_id}","starred_url":"https://api.github.com/users/ryanfitzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryanfitzer/subscriptions","organizations_url":"https://api.github.com/users/ryanfitzer/orgs","repos_url":"https://api.github.com/users/ryanfitzer/repos","events_url":"https://api.github.com/users/ryanfitzer/events{/privacy}","received_events_url":"https://api.github.com/users/ryanfitzer/received_events","type":"User","site_admin":false},"created_at":"2015-09-02T20:09:46Z","updated_at":"2015-09-02T20:09:46Z","body":"@guybedford Thanks for the explanation. My confusion stemmed from conflating AMD with RequireJS. That SystemJS treats a top-level `require` as a CommonJS module instead of an AMD module (using `require` as implemented by RequireJS) was unclear. Here is an example:\r\n\r\n```js\r\nrequire( [ 'path/to/runtime-config' ], function() {\r\n\r\n    require( [ 'app/main' ], function( main ) {\r\n            // initialize app now that config is loaded...\r\n    });\r\n});\r\n````\r\n\r\nWhen running this file, I would receive an error stating that `require` was undefined. Once I added the reassignment boilerplate:\r\n\r\n```js\r\nwindow.define = System.amdDefine;\r\nwindow.require = window.requirejs = System.amdRequire;\r\n```\r\n\r\neverything worked as expected. I thought that changing everything over to `System.amd[Method]` would allow me to remove the boilerplate and use the same nested require-type solution. Your explanation make sense as to why that wouldn't work.\r\n"}}