meteor-mantra-kickstarter icon indicating copy to clipboard operation
meteor-mantra-kickstarter copied to clipboard

1.3 beta 8: Astronomy - Error: The "collection" property has to be an instance of...

Open bearcanrun opened this issue 8 years ago • 2 comments

When I run the kickstarter in 1.3 beta 8: I get Error: The "collection" property has to be an instance of the "Mongo.Collection" in the "_color" class

If I pull _colors from collections.js and use directly in colors.js, the error goes away.

import {Mongo} from 'meteor/mongo';

var _colors = new Mongo.Collection('_colors')

const Model = Astro.Class({
  name: '_color',
  collection: _colors,

Of course when I go test it, more things are broken, like method '.find' not found. But I'm not sure if this is an Astronomy or Meteor 1.3 problem.

bearcanrun avatar Feb 10 '16 23:02 bearcanrun

+1 Same at here.

bright-sea avatar Feb 11 '16 17:02 bright-sea

This issue existing at 1.3beta 6 & 1.3 beta 7 as well.

A simple fix of this issue is :

change code in /lib/collections.js from

export default {
  Posts: new Mongo.Collection('posts'),
  Comments: new Mongo.Collection('comments')
  ,_colors: new Mongo.Collection('_colors')
};

to

export const Posts = new Mongo.Collection('posts');
export const Comments = new Mongo.Collection('comments');
export const _colors = new Mongo.Collection('_colors');

Everything works fine now.

bright-sea avatar Feb 11 '16 18:02 bright-sea