yogiben / meteor-starter

Kickstart your meteor projects
MIT License
424 stars 145 forks source link

Collections not available to client code when defined in /lib/collections #83

Open brylie opened 9 years ago

brylie commented 9 years ago

We are following the pattern of defining our collections in /collections. However, on some client code, we get errors such as CollectionName is not defined. Where should collections be defined to ensure they are always available in client/server code?

brylie commented 9 years ago

Two times when we are getting the CollectionName is not defined:

mpowaga commented 9 years ago

If you can wrap your code in Meteor.startup when you want to access collection object. Other pattern you may use is to define collections in a local package (or each collection in separate packages) and add it to your project.