Why aren't any of collections being defined after publishing them?
<p>I keep on getting these error messages in my browser console: <br></p>

<pre><code>Exception in template helper: ReferenceError: "CollectionNames" is not defined
</code></pre>

<p>The "CollectionNames" being all the collections I have in my app. I have researched but cant find a suitable solution.</p>

<p>My environment: <br>I am running meteor 1.2 <br></p>

<p>The task.js file is where I define each collection. Below is the code in task.js <br><br>
/myMeteorApp <br>
--/imports/api/tasks.js </p>

<pre><code>import { Mongo } from "meteor/mongo";
import { Template } from 'meteor/templating';
import { ReactiveVar } from 'meteor/reactive-var';

Images = new FS.Collection("images", {
stores: [new FS.Store.FileSystem("images", {path: "~/uploads"})] });

buyList = new Mongo.Collection("BuyList");

WhoAreWe = new Mongo.Collection("whoDb");
merchantReviews = new Mongo.Collection("merchantReviews");

Messages = new Meteor.Collection("messages", {transform: function (doc) 
{ doc.buyListObj = buyList.find({sessionIDz: {$in: [doc.buyList]}});  return doc; }});
</code></pre>

<p>The server is where I publish the collections. Below is the code: <br>
/myMeteorApp <br>
--/server/main.js</p>

<pre><code>import buyList from '../imports/api/tasks.js';
import Messages from '../imports/api/tasks.js';
import Images from '../imports/api/tasks.js';
import WhoAreWe from '../imports/api/tasks.js';
import merchantReviews from '../imports/api/tasks.js';

Meteor.startup(() =&gt; {
// code to run on server at startup

Meteor.publish('buyList', function(){
return buyList.find();
});


Meteor.publish('Messages', function(){
return Messages.find();
});

Meteor.publish('Images', function(){
return Messages.find();
});


Meteor.publish('WhoAreWe', function(){
return WhoAreWe.find();
});

Meteor.publish('merchantReviews', function(){
return merchantReviews.find();
});

});
</code></pre>

<p><br> And the client is where I subscribe for the collections. Find below the code: <br></p>

<p>/myMeteorApp <br>
--/client/main.js</p>

<pre><code>import { Template } from 'meteor/templating';
import { ReactiveVar } from 'meteor/reactive-var';
import './main.html';

Meteor.subscribe('Messages');
Meteor.subscribe('WhoAreWe');
Meteor.subscribe('Images');
Meteor.subscribe('buyList');
</code></pre>

<p>Where am I going wrong. I've been at this for many days now... Kindly help! </p>