Angular2 Tutorial - Mongo namespace error

I finished the 3rd section of the tutorial and everything is working fine, live updating from Mongo insertions and everything, but I receive the following error while meteor is running.

[web.browser] client/app.ts (14, 12): Cannot find namespace 'Mongo'.
[web.browser] collections/players.ts (1, 26): Cannot find name 'Mongo'.
[os.osx.x86_64] server/main.ts (3, 1): Cannot find name 'Meteor'.```

My app.ts is almost identical, except I use the word players vs parties. It’s here:

import {Component, View, NgZone} from 'angular2/core';

import {Players} from 'collections/players';

import {bootstrap} from 'angular2-meteor';

    selector: 'app',
    templateUrl: 'client/app.html'

export class Socially{

  players: Mongo.Cursor<Object>;

    this.players = Players.find();


And here is my server/main.ts:

import {loadPlayers} from './load-players';


Any ideas? I also don’t have a main.d.ts file in my typings/ folder, but again. everything seems to be working.


Same exact error here. Kind of irritating.

EDIT: Fixed it.

At some point I messed up and over-wrote my typings folder, removing the main.d.ts file that was generated.

Just rerun:

npm install typings -g
typings install meteor --ambient
typings install es6-promise --ambient
typings install es6-shim --ambient
1 Like

Thank you. I looked over this and my main.d.ts file wasn’t created. I ran
typings outside of the main directory :slight_smile: