The error message "Mongo is not defined" appeared in Meteor version 1.0.3.1

I am in the process of developing a package that aligns with the guidelines in the Discover Meteor book. You can find more information about this process in the following link:

Below is a snippet of my package.js file:

api.use(['email1','email2','email3','email4'],'client',{ unordered: true });

Additionally, here is an excerpt from my errors.js file:

Errors = {
  collection: new Mongo.Collection(null),
  ...
}

Despite implementing the above configurations, I encountered the following error:

W20150206-21:52:14.453(-5)? (STDERR)          
W20150206-21:52:14.454(-5)? (STDERR) /Users/Diego/.meteor/packages/meteor-tool/.1.0.40.959pzb++os.os.x86_64+web.browser+web.cordova/meteor-tool-os.os.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:173
W20150206-21:52:14.454(-5)? (STDERR)                        throw(ex);
W20150206-21:52:14.454(-5)? (STDERR)                              ^
W20150206-21:52:14.456(-5)? (STDERR) ReferenceError: Mongo is not defined
W20150206-21:52:14.456(-5)? (STDERR)     at Package (packages/diegoferreyra:errors/errors.js:2:1)
W20150206-21:52:14.456(-5)? (STDERR)     at /Users/Diego/Documents/htdocs/microscope/.meteor/local/build/programs/server/packages/diegoferreyra_errors.js:26:4
W20150206-21:52:14.456(-5)? (STDERR)     at /Users/Diego/Documents/htdocs/microscope/.meteor/local/build/programs/server/packages/diegoferreyra_errors.js:35:3
W20150206-21:52:14.456(-5)? (STDERR)     at /Users/Diego/Documents/htdocs/microscope/.meteor/local/build/programs/server/boot.js:205:10
W20150206-21:52:14.456(-5)? (STDERR)     at Array.forEach (native)
W20150206-21:52:14.456(-5)? (STDERR)     at Function._.each._.forEach (/Users/Diego/.meteor/packages/meteor-tool/.1.0.40.959pzb++os.os.x86_64+web.browser+web.cordova/meteor-tool-os.os.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20150206-21:52:14.456(-5)? (STDERR)     at /Users/Diego/Documents/htdocs/microscope/.meteor/local/build/programs/server/boot.js:116:5

I have already looked into a similar issue discussed in this post: meteor 0.9.1 , Mongo is not defined inside my custom Package

Unfortunately, despite including Mongo in the array, the problem persists.

Answer №1

Alright, after some digging, I discovered the (silly) mistake:

What I originally did:

api.addFiles(['errors.js','errors_list.html','errors_list.js']);

What I should have done:

api.addFiles(['errors.js','errors_list.html','errors_list.js'],'client');

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the proper way to combine two arrays containing objects together?

I am faced with the challenge of merging arrays and objects. Here is an example array I am working with: [ { name: "test", sub: { name: "asdf", sub: {} } }, { name: "models", sub: {} } ] ...

streaming an HTML5 video directly from memory source

After retrieving multiple encrypted data using ajax queries and performing necessary manipulations to turn them into a valid video, I find myself at a standstill. The binary of the video is now stored in memory, but I am unsure how to display it. To confi ...

Unable to send a post request using ajax

Section of Form in home.php <div id='googleForm'> <form> <div class='item'> <label class='label'>Full Name</label> <input class=&apos ...

What is the best way to verify a date in the format (yyyy-mm-dd) using jQuery?

I'm in the process of validating a date with the format (yyyy-mm-dd). I came across a solution, but it's not quite what I need as it's in the format (mm/dd/yyyy). You can check out the solution here: http://jsfiddle.net/ravi1989/EywSP/848/ ...

Creating a Chrome extension with Angular 5: A comprehensive guide

Currently, I am in the process of developing a Chrome extension using Angular 5. Initially, I successfully created a basic Angular app with the help of Angular Material and it functioned perfectly as an Angular application (I used ng build for verification ...

What is the best approach to animating a specified quantity of divs with CSS and javascript?

How neat is this code snippet: <div class="container"> <div class="box fade-in one"> look at me fade in </div> <div class="box fade-in two"> Oh hi! i can fade too! </div> <div class="box fade-in three"& ...

Creating a customized pagination feature in Angular 8 without relying on material design components

I am looking to implement pagination in my Angular 8 project without relying on any material library. The data I receive includes an array with 10 data rows, as well as the first page link, last page link, and total number of pages. Server Response: { ...

Problem encountered when utilizing the jQuery method .load()

Currently, there is an issue on my website where I am trying to load the content of a PHP file into a <div>. After ruling out any server-side problems, I have come to seek help with this question: Is there anything incorrect in the following code? & ...

What is the process for implementing an image as the background instead of a color for each column in a Google chart?

I'm currently working with Google Chart and I have set up a column chart. However, I am looking to display a background image instead of a background color in each column. Is this achievable with Google Chart? If so, how can I accomplish this? If anyo ...

What can I do to keep my navbar on top of the slideshow?

https://i.sstatic.net/SfiLZ.jpg Is there a way to create a responsive navbar that sits in front of a slideshow containing images? I attempted to place the div within the main, but unfortunately it was unsuccessful. ...

Tips for transitioning from custom CSS to Material UI's CSS in JS

I came across a project where someone implemented components with custom CSS. One interesting thing I noticed was a wrapper component, similar to Material UI's Container or just a simple div with applied styles. export const Container = styled.div` ...

Firing ng-change with fileModel or input type="file"

Is there a way to trigger ng-change when a change occurs with this file directive? I have implemented a custom file directive for this purpose. The Directive: app.directive('ngFileModel', ['$parse', function($parse) { return { ...

Experiencing problems with npm and bower installations, along with deprecated modules while setting up angular-phonecat project

Trying to execute npm install in terminal while setting up angular-phonecat based on instructions from https://docs.angularjs.org/tutorial Encountering issues with deprecated modules and errors during the bower install phase. Seeking advice on how to upd ...

What is the process for integrating a tensorflow.js model into a React-based web application?

I've been working on a React web application in Typescript that involves loading a tensorflow.js model and then applying it each time the component updates. While I successfully implemented this in a small demo app without React, I am facing some chal ...

Performing an XMLHttpRequest to Submit an HTML Form

Our Current HTML Form Setup This is an example of the HTML form we are currently using. <form id="demo-form" action="post-handler.php" method="POST"> <input type="text" name="name" value=" ...

Which element from the context menu has been selected?

We specialize in creating browser extensions for Chrome, Firefox, and Safari. Our latest project involves implementing context menus within the extensions that will appear when users right-click on any editable form element. I attempted to incorporate an e ...

Showcase big image upon hovering mouse with automatic positioning on Magento

As a newcomer to magento, I am interested in adding an effect that displays a large image when hovering over it with the mouse. This feature should automatically position itself on the product listing page in magento. Your assistance is greatly appreciate ...

A JavaScript function that fetches the color name based on either the RGB value or the Hexadecimal value

Looking for a JavaScript function that can determine the name of a color. Would like the JavaScript function to be structured as shown below: function getColorName(r, g, b) { .... return <color name>; // such as blue, cyan, magenta, etc. } ...

Top method for identifying "abandoned words" within text that has been wrapped

Our content and design teams have a specific request to prevent paragraphs from ending with an "orphan word" - a single word on the last line of text that has wrapped onto multiple lines. The designer's proposed solution is to adjust the margins sligh ...

Update the image source through an AJAX call

I've experimented with various methods to update an image src using an AJAX request. The new URL is obtained through the AJAX call, and when inspecting the data in Developer Tools, the 'DATA' variable contains the correct URL. However, the i ...