Iron router: Error: Could not find template named "/" or "". Are you sure you have identified it?

I have a problem with setting up simple hardware: router example: ( docs , sample application )

meteor create testapp
cd testapp

      

home.html

<template name="Home">
  <h1>Welcome</h1>
  home
</template>

      

router.js

Router.route('/', function () {
  this.render('Home'); // Also tried 'home'
});

      

Server start:

meteor

      

Then I get (client side):

Exception from Tracker recompute function: Error: Couldn't find a template named "/" or "". Are you sure you defined it?
    at null._render (http://localhost:3000/packages/iron_dynamic-template.js?32038885cb1dad7957291ffebfffcb7f8cd57d20:239:17)
    at doRender (http://localhost:3000/packages/blaze.js?88aac5d3c26b7576ac55bb3afc5324f465757709:1853:25)
    ...

      

What am I doing wrong?

Note. I get the same error if I clone the sample app (basic.html and basic.js).

meteor list
autopublish      1.0.1  Publish the entire database to all clients
insecure         1.0.1  Allow all database writes by default
iron:router      0.9.4  Routing specifically designed for Meteor
meteor-platform  1.1.2  Include a standard set of Meteor packages in your app

      

also:

meteor --version
Meteor 0.9.4 <- Why all standard packages and meteor platform are > 1.0 and this is 0.9.4 ?

      

+3


source to share


1 answer


There are currently two versions iron:router

.

  • iron:router@0.9.4

    is the one added by default as you type meteor add iron:router

    , this version is the latest in the "legacy" branch iron:router

    that came over a year ago, this is the one that is probably still using, although they should definitely update to ...
  • iron:router@1.0.0-preX

    with X = 4

    as of 10/20/2014, which is a complete package processing intended for backward compatibility, but introduces a new, more comfortable and polished API. This version will likely be installed by default when the meteorite reaches 1.0.0 this year. The problem is that the github page iron:router

    shows this particular branch ( 1.0.0-pre4

    ) along with examples people think can be used with 0.9.4

    .

This means that you are most likely using the wrong version of the iron router, uninstall it with meteor remove iron:router

and instead meteor add iron:router@1.0.0-pre4

.



Recommended reading for the latest syntax iron:router

:

http://eventedmind.github.io/iron-router/

Sometimes the guide is not fully updated with a preview, if you want to keep up with the latest stuff take a look at the github issues.

+2


source







All Articles