Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meteor: EJSON is not defined

Tags:

meteor

I'm trying to use a private JSON file to add some simple template documents to the mongo collection if it is empty:

if (Passions.find().count() === 0) {
  mockPassions = JSON.parse(Assets.getText("mockups/passions.json"));
  _.each(mockPassions.passions, function(passion) {
    return Passions.insert(passion);
  });
}

I'm getting the error:

ReferenceError: EJSON is not defined

Does anyone have any clue? I'm using Meteor 0.6.5.
Thanks

like image 247
Hamal000 Avatar asked Aug 13 '26 16:08

Hamal000


1 Answers

You need to bring EJSON up to the global namespace via

meteor add ejson

In meteor 0.6.5 unless you explicitly tell it to, packages are namespaced into package

like image 144
Tarang Avatar answered Aug 16 '26 19:08

Tarang



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!