{"action":"created","issue":{"url":"https://api.github.com/repos/liferay/liferay-amd-loader/issues/65","repository_url":"https://api.github.com/repos/liferay/liferay-amd-loader","labels_url":"https://api.github.com/repos/liferay/liferay-amd-loader/issues/65/labels{/name}","comments_url":"https://api.github.com/repos/liferay/liferay-amd-loader/issues/65/comments","events_url":"https://api.github.com/repos/liferay/liferay-amd-loader/issues/65/events","html_url":"https://github.com/liferay/liferay-amd-loader/issues/65","id":152721716,"number":65,"title":"Manually loaded anonymous modules will throw in the next loader request ","user":{"login":"jbalsas","id":905006,"avatar_url":"https://avatars.githubusercontent.com/u/905006?v=3","gravatar_id":"","url":"https://api.github.com/users/jbalsas","html_url":"https://github.com/jbalsas","followers_url":"https://api.github.com/users/jbalsas/followers","following_url":"https://api.github.com/users/jbalsas/following{/other_user}","gists_url":"https://api.github.com/users/jbalsas/gists{/gist_id}","starred_url":"https://api.github.com/users/jbalsas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbalsas/subscriptions","organizations_url":"https://api.github.com/users/jbalsas/orgs","repos_url":"https://api.github.com/users/jbalsas/repos","events_url":"https://api.github.com/users/jbalsas/events{/privacy}","received_events_url":"https://api.github.com/users/jbalsas/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/liferay/liferay-amd-loader/labels/help%20wanted","name":"help wanted","color":"159818"},{"url":"https://api.github.com/repos/liferay/liferay-amd-loader/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2016-05-03T08:15:23Z","updated_at":"2016-05-18T21:25:40Z","closed_at":"2016-05-18T21:20:54Z","body":"Right now, if an anonymous module is loaded manually using `<script>`, the loader will try to name it on the next script load and will throw an exception.\r\n\r\n**Steps to reproduce:**\r\n\r\nUpdate the [demo](https://github.com/liferay/liferay-amd-loader/blob/master/src/demo/index.html#L14) adding:\r\n\r\n```html\r\n<script src=\"//localhost:8080/demo/modules3/a.js\"></script>\r\n```\r\n\r\nIt will throw the `Multiple anonymous modules cannot be served...` error on the first loader `scriptload`.\r\n\r\nI'm not sure if this is an issue or something we can do at all, but the logic seems a bit off, since it will always throw. It doesn't seem to affect anything else, so maybe we should just signal it with a `console.warn` instead of throwing an error.\r\n\r\nWhat do you think?"},"comment":{"url":"https://api.github.com/repos/liferay/liferay-amd-loader/issues/comments/220163006","html_url":"https://github.com/liferay/liferay-amd-loader/issues/65#issuecomment-220163006","issue_url":"https://api.github.com/repos/liferay/liferay-amd-loader/issues/65","id":220163006,"user":{"login":"ipeychev","id":78014,"avatar_url":"https://avatars.githubusercontent.com/u/78014?v=3","gravatar_id":"","url":"https://api.github.com/users/ipeychev","html_url":"https://github.com/ipeychev","followers_url":"https://api.github.com/users/ipeychev/followers","following_url":"https://api.github.com/users/ipeychev/following{/other_user}","gists_url":"https://api.github.com/users/ipeychev/gists{/gist_id}","starred_url":"https://api.github.com/users/ipeychev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipeychev/subscriptions","organizations_url":"https://api.github.com/users/ipeychev/orgs","repos_url":"https://api.github.com/users/ipeychev/repos","events_url":"https://api.github.com/users/ipeychev/events{/privacy}","received_events_url":"https://api.github.com/users/ipeychev/received_events","type":"User","site_admin":false},"created_at":"2016-05-18T21:25:40Z","updated_at":"2016-05-18T21:25:40Z","body":"Hey Chema,\r\n\r\nI think we cannot use [currentScript](https://developer.mozilla.org/en-US/docs/Web/API/Document/currentScript), because is not supported in IE, is it?\r\nI committed a possible [fix](https://github.com/liferay/liferay-amd-loader/commit/6183b09bec673bf8f46dad952395ff7b1c861a6c), could you please tell me if it works for you too?\r\n\r\nAbout the anonymous modules - yeah, I hate them with passion. The inventor of anonymous modules should receive a condom as a gift, to not reproduce. \r\n\r\nThanks,\r\n\r\n"}}