JohnL
JohnL

Reputation: 14114

Meteor collection undefined despite having the files in a lib directory

After looking at the various comments on the net, most of which say, "put them in the lib directory", I'm still at a loss as to where to put my collections js files. It seems no matter where I put them there is an issue. I've tried them in the client directory, lib directory, lib/collections directory. All to no avail. What else could I be missing.

import { Mongo } from 'meteor/mongo';
export const Subjects = new Mongo.Collection('subjects');

Upvotes: 0

Views: 156

Answers (1)

JohnL
JohnL

Reputation: 14114

The immediate issue was in the way I was importing. I had:

import Subjects from '../../../../lib/collections/subjects.js';

but the following fixed it:

import {Subjects} from '../../../../lib/collections/subjects.js';

Upvotes: 1

Related Questions