Tutorial Failure at 3rd page 2015-04-16


#1
hello world,

I am having a difficult time with the tutorial.

Currently I am on this page:

https://www.meteor.com/try/3

The first failure was this command:

meteor mongo

According to google that command now fails due to a known bug.

So, I work around it with this command:

mongo --port 3001

Next I tried this command from the mongo prompt:

dan@u77:~/mets/simple-todos $ 
dan@u77:~/mets/simple-todos $ 
dan@u77:~/mets/simple-todos $ mongo --port 3001
MongoDB shell version: 2.6.7
connecting to: 127.0.0.1:3001/test
meteor:PRIMARY> 
meteor:PRIMARY> db.tasks.insert({ text: "Hello world!", createdAt: new Date() });
WriteResult({ "nInserted" : 1 })
meteor:PRIMARY> 
meteor:PRIMARY> 

According to the tutorial, I should now see a task at this URL:

http://localhost:3000

But, I see nothing.

I'd welcome any tips on fixing this.

This should be an easy bug to reproduce.

Just spend 3 minutes to walk through the first 3 pages of the tutorial.

Currently I have these two files:

// simple-todos.js

Tasks = new Mongo.Collection("tasks");

if (Meteor.isClient) {
  // This code only runs on the client
  Template.body.helpers({
    tasks: function () {
      return Tasks.find({});
    }
  });
}



<!-- simple-todos.html -->
<head>
  <title>Todo List</title>
</head>

<body>
  <div class="container">
    <header>
      <h1>Todo List</h1>
    </header>

    <ul>
      {{#each tasks}}
        {{> task}}
      {{/each}}
    </ul>
  </div>
</body>

<template name="task">
  <li>{{text}}</li>
</template>

#2

Can you try writing

Tasks = new Meteor.Collection("tasks");

instead of what you have i.e

Tasks = new Mongo.Collection("tasks");

#3

The meteor app uses a db named: meteor

I used this command inside the mongo CLI to fix the problem:

use meteor

#4

I ran into this issue and the reason was because I’d forgotten to import tasks.js in servers/main.js:

import ‘…/imports/api/tasks.js’;

The tutorial does suggest this.