Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
brylie opened this issue Jul 2, 2015 · 2 comments
Open

Comments

@brylie
Copy link
Contributor

brylie commented Jul 2, 2015

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
Copy link
Contributor Author

brylie commented Jul 2, 2015

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

  • When calling the CollectionName from within /lib or /both
  • When calling the CollectionName from within /collections/hooks/

@mpowaga
Copy link
Collaborator

mpowaga commented Jul 12, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants