scttnlsn / backbone.io

Backbone.js sync via Socket.IO
http://scttnlsn.github.io/backbone.io
541 stars 66 forks source link

Uncaught TypeError: Object {object} has no method 'ready' #57

Closed awm33 closed 10 years ago

awm33 commented 10 years ago

Hi,

I keep getting an error of Uncaught TypeError: Object {object} has no method 'ready' sometimes. {object} being the model or collection name. users or enrollment in my case.

It only happens part of the time. I'm not sure why. It looks like either backbone.io isn't loading in time or not executing in time.

I am using require.js. I'm naming backbone.io as a dependancy in the require.js config for each model and collection module. I've also tried using #55 but this doesn't seem to help.

Any ideas?

Thanks

dminkovsky commented 10 years ago

Hi @awm33, are you still experiencing this error? Could you cite a line number?

Take a look at my update to #55. The dependencies seem to be set up correctly there.

awm33 commented 10 years ago

I was able to resolve it by including backbone.io as a requirement in each model/collection, which I wasn't doing before. Silly mistake on my end, but you do have to list each as dependent and require in each model/collection file.