ms-seo icon indicating copy to clipboard operation
ms-seo copied to clipboard

Warning: "You called Router.url for a route named undefined but that route doesn't seem to exist. Are you sure you created it?"

Open Obiwarn opened this issue 10 years ago • 7 comments

On startup of my app

Obiwarn avatar Jan 20 '15 12:01 Obiwarn

same happening here: https://github.com/matteodem/meteor-boilerplate/issues/71

matteodem avatar Feb 02 '15 16:02 matteodem

Same, started getting this when I installed ms-seo.

proehlen avatar Jun 06 '15 08:06 proehlen

Same here = / Started receiving the warning after installing ms-seo; regardless of adding/removing seo config.

kyooriouskoala avatar Jul 03 '15 06:07 kyooriouskoala

I had this issue because of my '/' route - I suspect the auto-naming of the route doesn't like slashes. This caused the issue:

Router.route('/', function () {
    if (Meteor.userId()) {
        this.render('dashboard');
    } else {
        this.render('attract');
    }
});

and this fixed it:

Router.route('/', function () {
    if (Meteor.userId()) {
        this.render('dashboard');
    } else {
        this.render('attract');
    }
}, {name: 'homePage'});

CarlQLange avatar Jul 13 '15 00:07 CarlQLange

Put a PR in that might fix the issue but haven't even run the lines in question. Have fun! :D If anything, what I shared above should fix your problem :)

CarlQLange avatar Jul 13 '15 00:07 CarlQLange

Thanks, @CarlQLange! The warning is gone now :)

kyooriouskoala avatar Jul 23 '15 05:07 kyooriouskoala

in case you want to redirect the "/" route (in most cases that's what you want?) you don't need the name property and you can solve the problem like this:

Router.route "/",
  path: "/"
  onBeforeAction: -> Router.go "/home"

translate to JS

faeb187 avatar Mar 13 '16 22:03 faeb187