Meteor-Files: Cannot read property 'FilesCollection' of undefined

Hi problem with Meteor-Files using with Nova inside packages

meteor 1.3.2_4 (need for nova) Meteor-Files v1.6.7

i have error Cannot read property 'FilesCollection' of undefined

import { FilesCollection } from 'meteor/ostrio:files';

var Images;

Images = new FilesCollection({
  debug: true,
  collectionName: 'Images',
  allowClientCode: false, // Disallow remove files from Client
  onBeforeUpload: function (file) {
    // Allow upload files under 10MB, and only in png/jpg/jpeg formats
    if (file.size <= 10485760 && /png|jpg|jpeg/i.test(file.extension)) {
      return true;
    } else {
      return 'Please upload image, with size equal or less than 10MB';
    }
  }
});

if (Meteor.isServer) {
  Images.denyClient();
  Meteor.publish('files.images.all', function () {
    return Images.find().cursor;
  });

 Meteor.publish('files.images.all', () => Images.find().cursor);

} else {

  Meteor.subscribe('files.images.all');
}


export default Images ;

i try change to Images = new Meteor.Files({ but not worked

and not worked update to coffeescript@=1.1.4

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 25 (22 by maintainers)

Commits related to this issue

Most upvoted comments

I’ll merge and publish new version of MF today, please hold on

Add ecamscript and/or modules package(s)

sorry me to I am not sure that disappeared, tonight check.

i solve, after put ‘mongo’ to https://github.com/VeliovGroup/Meteor-Files/blob/master/package.js

  api.use(['mongo','underscore', 'check', 'random', 'coffeescript@=1.1.4', 'ecmascript', 'ostrio:cookies@2.0.4'], ['client', 'server']);