iron-meteor / iron-router

A client and server side router designed specifically for Meteor.
MIT License
1.98k stars 414 forks source link

meteor iron:router not working #1601

Closed DDavis1025 closed 5 years ago

DDavis1025 commented 5 years ago

So I just started to use iron:router with meteor add iron:router with earlier versions as well and in my router.js file:

Router.route('/', function () { this.render('mainpage'); });

Router.route('/videopage');

and in a main.js file in my client without the router.js file

Router.route('/', function () { this.render('mainpage'); });

Router.route('/video', function () { this.render('video'); });

giving me this error

screen shot 2018-09-26 at 2 00 36 pm

This has worked for me in the past but not right now

amka commented 5 years ago

You have to create an .html file with template tag inside and add attribute name equals mainpage or video. Like this:

<template name="mainpage">
    <!--  Your content here -->
</template>