[Solved] Collections declarations not recognized by server neither client

Hello,

I decided to split my code in /client and /server directories and after some search I found that the best place to put my collections in this case is at /lib/collections.js.

But my server and client code aren’t able to recognize my Todos collections yet:

Exception from sub todos id tXsP9KPpoH2L8aFa5 ReferenceError: Todos is not defined

  • For server

Uncaught ReferenceError: Todos is not defined

  • For client

I saw that both server/app/collections.js and web.browser/app/collections.js at /.meteor/local/build/programs are empty! Also noticed that both program.json files from server and web.browser makes path references to app/lib/collections.js, but there is no lib directory there.

What I’m doing wrong?

Omg! I’m too stupid :flushed:
I was using a var keyword after declaration, then it remains only locally to the closure scope.
Sorry about that.