Meteor 1.3 (es6): Publications and subscriptions

I’m trying to use the following repo that uses ecmascript 6 to kickstart a small project. However I’m having trouble using collections (given that documentation on Meteor 1.3 with es6 is still rather scarce).

When exporting a collection from my lib/collection.js file and then importing it in a server/server.js file, I can insert in and then publish said description, however I’m having trouble subscribing to it in a client file (jsx or otherwise)

Here is my code:


const Test = new Mongo.Collection(“test”);
export default Test;


import Test from ‘/lib/collections.js’;
Test.insert({name: “Song”, createdAt: new Date()});
Test.insert({name: “Sing”, createdAt: new Date()});
Test.insert({name: “Sang”, createdAt: new Date()});
const machin = Meteor.publish(“test”, function(){


const handle = Meteor.subscribe(“test”);
console.log(handle); //The handle is displayed correctly

console.log(Test.findOne()); // Test Reference is not defined

I’m a beginner in both Javascript and Meteor, so if you could please explain to me what causes this behaviour and how to fix it, I would be grateful.
Also, any and all documentation pertaining to using Meteor with es6 syntax would be most welcome.

Thank you.

You need to return something from your publication so it should be:

const machin = Meteor.publish("test", function(){
  return Test.find(); 

Can it be that you need to import Test from '/lib/collections.js' in your client.js?

I just announced my Meteor-React-start-app which has publication and subscription working