angularjsnode.jsangular-meteor

Meteor - Using FS returns TypeError: Cannot read property 'Collection' of undefined


I am using Meteor 1.6 and AngularJS (Angular 1) and am having issues in my /server/main.js file. I am trying to do an import like this:

import { FS } from 'meteor/cfs:filesystem';

So Meteor is able to resolve it just fine, but the problem is, it is undefined somehow. So when I do this:

Images = new FS.Collection("images", {

I get the error mentioned above. I have been trying to find answers online and I've been referencing the Meteor Collection FS Documentation but haven't been able to resolve what I'm doing wrong with my import. Can anyone direct me how to fix this?


Solution

  • As pointed out on a Meteor forum, the trick with this one it to NOT import it. I don't know why I didn't try that before, but apparently the meteor/cfs:filesystem doesn't use api.export in their package.js file, so you can't import it. I was brought up to speed by robfallows in the Meteor forum