Open vuhpham opened 9 years ago
I've narrowed it down, in my case, to it being due to multiple Router.onBeforeActions
For example:
Router.onBeforeAction(requireLogin, {name: 'requireLogin', only: ['dealEdit', 'userDashboard','userSettings', 'userNotifications']});
Router.onBeforeAction(requireAdmin, {name: 'requireAdmin', only: ['admin']});
Will cause the error. Removing one of the Router.onBeforeActions seems to fix it.
I had a look to see if I could solve the issue but I don't have the time at the mo to get my head around how everything fits together.
As a bandaid fix, you can move the onBeforeAction into each of the routes and it doesn't seem to cause an issue e.g.
this.route('userNotifications', {
path: '/notifications',
onBeforeAction: requireLogin
});
+1 to tomwasd's solution. Thanks!
If you were using a onBeforeAction for the 'dataNotFound' plugin, you can change it from:
Router.onBeforeAction('dataNotFound', {only: ['myRoute1', 'myRoute2']});
to
Router.plugin('dataNotFound', {
notFoundTemplate: 'NotFound',
//except: ['server.route']
only: ['myRoute1', 'myRoute2']
});
EDIT: Welp, I thought that helped. Getting the error again, so perhaps not.
Hi forks, I got a blank page in IE11 with an error in console: Exception in callback of async function: Error: Handler with name 'hookWithOptions' already exists. Demo site of telescope got the same problem. Any idea about it?