{"action":"created","issue":{"url":"https://api.github.com/repos/Dogfalo/materialize/issues/634","labels_url":"https://api.github.com/repos/Dogfalo/materialize/issues/634/labels{/name}","comments_url":"https://api.github.com/repos/Dogfalo/materialize/issues/634/comments","events_url":"https://api.github.com/repos/Dogfalo/materialize/issues/634/events","html_url":"https://github.com/Dogfalo/materialize/issues/634","id":56808202,"number":634,"title":"Bug when used with AMD (require.js) - IMPORTNAT","user":{"login":"max1011","id":6626011,"avatar_url":"https://avatars.githubusercontent.com/u/6626011?v=3","gravatar_id":"","url":"https://api.github.com/users/max1011","html_url":"https://github.com/max1011","followers_url":"https://api.github.com/users/max1011/followers","following_url":"https://api.github.com/users/max1011/following{/other_user}","gists_url":"https://api.github.com/users/max1011/gists{/gist_id}","starred_url":"https://api.github.com/users/max1011/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/max1011/subscriptions","organizations_url":"https://api.github.com/users/max1011/orgs","repos_url":"https://api.github.com/users/max1011/repos","events_url":"https://api.github.com/users/max1011/events{/privacy}","received_events_url":"https://api.github.com/users/max1011/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":75,"created_at":"2015-02-06T12:51:45Z","updated_at":"2015-11-08T12:24:53Z","closed_at":null,"body":"the company i am working with likes material design, so i told them about materialize, and they said ok use it , no problem , but currently i am stuck with this so please help !\r\n\r\nwhen i try to require materialize , no errors are shown, but when i actually use it with jquery, it tells me that the method that i am trying to use on that element is undefined\r\nhere is my code (js):\r\n```javascript\r\nrequirejs.config({\r\n  paths: {\r\n    'materialize': '../../bower_components/materialize/dist/js/materialize',\r\n    'jquery': '../../bower_components/jquery/dist/jquery'\r\n  },\r\n  shim: {\r\n    'materialize': {\r\n      deps: ['jquery']\r\n    },\r\n    'jquery': {\r\n      exports: '$'\r\n    }\r\n  }\r\n});\r\n\r\nrequire(['jquery', 'materialize'], function($) {\r\n  $('select').material_select();\r\n});\r\n```\r\nScreen Shot: \r\n![image](https://cloud.githubusercontent.com/assets/6626011/6079567/92fbe448-ae0f-11e4-94e6-222736a11ee0.png)\r\n"},"comment":{"url":"https://api.github.com/repos/Dogfalo/materialize/issues/comments/154820377","html_url":"https://github.com/Dogfalo/materialize/issues/634#issuecomment-154820377","issue_url":"https://api.github.com/repos/Dogfalo/materialize/issues/634","id":154820377,"user":{"login":"max1011","id":6626011,"avatar_url":"https://avatars.githubusercontent.com/u/6626011?v=3","gravatar_id":"","url":"https://api.github.com/users/max1011","html_url":"https://github.com/max1011","followers_url":"https://api.github.com/users/max1011/followers","following_url":"https://api.github.com/users/max1011/following{/other_user}","gists_url":"https://api.github.com/users/max1011/gists{/gist_id}","starred_url":"https://api.github.com/users/max1011/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/max1011/subscriptions","organizations_url":"https://api.github.com/users/max1011/orgs","repos_url":"https://api.github.com/users/max1011/repos","events_url":"https://api.github.com/users/max1011/events{/privacy}","received_events_url":"https://api.github.com/users/max1011/received_events","type":"User","site_admin":false},"created_at":"2015-11-08T12:24:53Z","updated_at":"2015-11-08T12:24:53Z","body":"@vaibhav93 the way those plugins are loading is asynchronous , meaning that there is a problem in the order in which they are loaded, so if you load them synchronously it will block script execution and downloading until it's done downloading and executing, then it continues to run the other materialize script which requires to to run at some point , if they are loaded before it wants it it's ok and that's why if you load them manually it works, i should change a bit of how those modules are loaded in a bit more effective way so that we can make sure when materialize wants a certain function from another file it's already loaded, all of this means the entire problem is moving from sync to a-sync (from normal to AMD way), async is known to create alot of problems because of the way it behaves, so i will test your code and fix it as soon as i can, for now stick with your solution ."}}