ms-seo
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?"
On startup of my app
same happening here: https://github.com/matteodem/meteor-boilerplate/issues/71
Same, started getting this when I installed ms-seo.
Same here = / Started receiving the warning after installing ms-seo; regardless of adding/removing seo config.
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'});
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 :)
Thanks, @CarlQLange! The warning is gone now :)
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"