{"action":"created","issue":{"url":"https://api.github.com/repos/devote/HTML5-History-API/issues/73","labels_url":"https://api.github.com/repos/devote/HTML5-History-API/issues/73/labels{/name}","comments_url":"https://api.github.com/repos/devote/HTML5-History-API/issues/73/comments","events_url":"https://api.github.com/repos/devote/HTML5-History-API/issues/73/events","html_url":"https://github.com/devote/HTML5-History-API/issues/73","id":77608382,"number":73,"title":"Mismatched anonymous define() module because of #57","user":{"login":"Thinkscape","id":270528,"avatar_url":"https://avatars.githubusercontent.com/u/270528?v=3","gravatar_id":"","url":"https://api.github.com/users/Thinkscape","html_url":"https://github.com/Thinkscape","followers_url":"https://api.github.com/users/Thinkscape/followers","following_url":"https://api.github.com/users/Thinkscape/following{/other_user}","gists_url":"https://api.github.com/users/Thinkscape/gists{/gist_id}","starred_url":"https://api.github.com/users/Thinkscape/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Thinkscape/subscriptions","organizations_url":"https://api.github.com/users/Thinkscape/orgs","repos_url":"https://api.github.com/users/Thinkscape/repos","events_url":"https://api.github.com/users/Thinkscape/events{/privacy}","received_events_url":"https://api.github.com/users/Thinkscape/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-18T10:56:37Z","updated_at":"2015-05-22T10:46:45Z","closed_at":"2015-05-22T10:46:45Z","body":"#57 introduced a bug, where there's a race condition between page loading and `define()` call.\r\n\r\n````js\r\n(function(factory) {\r\n    if (typeof define === 'function' && define['amd']) {\r\n        // https://github.com/devote/HTML5-History-API/issues/57#issuecomment-43133600\r\n        define(typeof document !== \"object\" || document.readyState !== \"loading\" ? [] : \"html5-history-api\", factory);\r\n    } else {\r\n        factory();\r\n    }\r\n})\r\n````\r\n\r\nWith `require.js` optimized script it should alway works, however the above relies on `document.readyState !== \"loading\"` which means, that depending on how the page is loaded it will often fail with `Uncaught Error: Mismatched anonymous define() module`\r\n"},"comment":{"url":"https://api.github.com/repos/devote/HTML5-History-API/issues/comments/104616295","html_url":"https://github.com/devote/HTML5-History-API/issues/73#issuecomment-104616295","issue_url":"https://api.github.com/repos/devote/HTML5-History-API/issues/73","id":104616295,"user":{"login":"devote","id":367691,"avatar_url":"https://avatars.githubusercontent.com/u/367691?v=3","gravatar_id":"","url":"https://api.github.com/users/devote","html_url":"https://github.com/devote","followers_url":"https://api.github.com/users/devote/followers","following_url":"https://api.github.com/users/devote/following{/other_user}","gists_url":"https://api.github.com/users/devote/gists{/gist_id}","starred_url":"https://api.github.com/users/devote/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devote/subscriptions","organizations_url":"https://api.github.com/users/devote/orgs","repos_url":"https://api.github.com/users/devote/repos","events_url":"https://api.github.com/users/devote/events{/privacy}","received_events_url":"https://api.github.com/users/devote/received_events","type":"User","site_admin":false},"created_at":"2015-05-22T10:46:45Z","updated_at":"2015-05-22T10:46:45Z","body":"fixed"}}