{"action":"created","issue":{"url":"https://api.github.com/repos/clappr/clappr/issues/453","labels_url":"https://api.github.com/repos/clappr/clappr/issues/453/labels{/name}","comments_url":"https://api.github.com/repos/clappr/clappr/issues/453/comments","events_url":"https://api.github.com/repos/clappr/clappr/issues/453/events","html_url":"https://github.com/clappr/clappr/issues/453","id":76748935,"number":453,"title":"Error when loading clappr with RequireJs","user":{"login":"tjenkinson","id":3259993,"avatar_url":"https://avatars.githubusercontent.com/u/3259993?v=3","gravatar_id":"","url":"https://api.github.com/users/tjenkinson","html_url":"https://github.com/tjenkinson","followers_url":"https://api.github.com/users/tjenkinson/followers","following_url":"https://api.github.com/users/tjenkinson/following{/other_user}","gists_url":"https://api.github.com/users/tjenkinson/gists{/gist_id}","starred_url":"https://api.github.com/users/tjenkinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjenkinson/subscriptions","organizations_url":"https://api.github.com/users/tjenkinson/orgs","repos_url":"https://api.github.com/users/tjenkinson/repos","events_url":"https://api.github.com/users/tjenkinson/events{/privacy}","received_events_url":"https://api.github.com/users/tjenkinson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-05-15T14:45:03Z","updated_at":"2015-05-17T21:38:13Z","closed_at":null,"body":"I am getting this error in the console when trying to load clappr with requirejs and can't figure out why.\r\n\r\n`Uncaught TypeError: template is not a function`\r\n\r\nI've downloaded v0.1.2 and placed the clappr.js file in my lib folder.\r\n\r\nThen when I try and try to require and use it\r\n![image](https://cloud.githubusercontent.com/assets/3259993/7655033/faeaee5e-fb18-11e4-960f-57321bff49fc.png)\r\n\r\nI get this error in the console:\r\n![image](https://cloud.githubusercontent.com/assets/3259993/7655048/08948cd6-fb19-11e4-96e0-b036328eef03.png)\r\n\r\n![image](https://cloud.githubusercontent.com/assets/3259993/7655069/25615718-fb19-11e4-8fce-f6dd76902424.png)\r\n\r\nAny ideas why? Is my requirejs somehow conflicting with your require calls?"},"comment":{"url":"https://api.github.com/repos/clappr/clappr/issues/comments/102860936","html_url":"https://github.com/clappr/clappr/issues/453#issuecomment-102860936","issue_url":"https://api.github.com/repos/clappr/clappr/issues/453","id":102860936,"user":{"login":"towerz","id":989801,"avatar_url":"https://avatars.githubusercontent.com/u/989801?v=3","gravatar_id":"","url":"https://api.github.com/users/towerz","html_url":"https://github.com/towerz","followers_url":"https://api.github.com/users/towerz/followers","following_url":"https://api.github.com/users/towerz/following{/other_user}","gists_url":"https://api.github.com/users/towerz/gists{/gist_id}","starred_url":"https://api.github.com/users/towerz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/towerz/subscriptions","organizations_url":"https://api.github.com/users/towerz/orgs","repos_url":"https://api.github.com/users/towerz/repos","events_url":"https://api.github.com/users/towerz/events{/privacy}","received_events_url":"https://api.github.com/users/towerz/received_events","type":"User","site_admin":false},"created_at":"2015-05-17T21:38:13Z","updated_at":"2015-05-17T21:38:13Z","body":"Hi @tjenkinson, it seems your workaround is the only solution for now.\r\n\r\nWe use browserify to build the Clappr bundle, and it defines a global `require` function that conflicts with requirejs own implementation. We can't force using a closure around the resulting bundle and risk breaking external plugins that depend on the `require` function.\r\n\r\nWe're considering changing the bundle to use webpack, which will probably give us a little more control over how the package is built. I'll add a reference to this issue so we can keep this limitation in mind."}}