iron:router - Route dispatch never rendered. Did you forget to call this.next() in an onBeforeAction

1,095 views
Skip to first unread message

Nuno Vidal

unread,
Nov 4, 2014, 12:22:07 PM11/4/14
to meteo...@googlegroups.com
When in my Meteor app I browse to a URL of the type http://SERVER/redeem/slug like http://localhost:3000/redeem/4654febb-39d1-4056-a413-e9bbb934ac19 I get the following console error.

executing AccountsTemplates.init() accounts-templates.js?d47d85d67c512f7c5896e4452012a1deeec52dd0:256
Accounts.onEmailVerificationLink was called more than once. Only one callback added will be executed. debug.js:41
Exception in callback of async function: Error: Match error: Expected string, got object
    at checkSubtree
(http://localhost:3000/packages/check.js?803a2be518a0c6c3949e45cf65c4ad627a3d603a:190:13)
    at check
(http://localhost:3000/packages/check.js?803a2be518a0c6c3949e45cf65c4ad627a3d603a:67:5)
    at AT
.setPrevPath (http://localhost:3000/packages/useraccounts_core.js?46940b8d975209f0721048ca1d3a67ec55727e3f:902:5)
    at AT
.ensureSignedIn (http://localhost:3000/packages/useraccounts_core.js?46940b8d975209f0721048ca1d3a67ec55727e3f:954:27)
    at http
://localhost:3000/packages/iron_router.js?3fb4caf61f2b332b14dabb884ba512baa2663af2:1186:36
    at _
.extend.withValue (http://localhost:3000/packages/meteor.js?61916b1060b33931a21f104fbffb67c2f3d493c5:945:17)
    at hookWithOptions
(http://localhost:3000/packages/iron_router.js?3fb4caf61f2b332b14dabb884ba512baa2663af2:1185:27)
    at boundNext
(http://localhost:3000/packages/iron_middleware-stack.js?87fc6153735b0c669013d562b796bbd57c993d79:406:31)
    at http
://localhost:3000/packages/meteor.js?61916b1060b33931a21f104fbffb67c2f3d493c5:973:22
    at onRerun
(http://localhost:3000/packages/iron_router.js?3fb4caf61f2b332b14dabb884ba512baa2663af2:520:9) debug.js:41
Exception in callback of async function: Error: Match error: Expected string, got object
    at checkSubtree
(http://localhost:3000/packages/check.js?803a2be518a0c6c3949e45cf65c4ad627a3d603a:190:13)
    at check
(http://localhost:3000/packages/check.js?803a2be518a0c6c3949e45cf65c4ad627a3d603a:67:5)
    at AT
.setPrevPath (http://localhost:3000/packages/useraccounts_core.js?46940b8d975209f0721048ca1d3a67ec55727e3f:902:5)
    at AT
.ensureSignedIn (http://localhost:3000/packages/useraccounts_core.js?46940b8d975209f0721048ca1d3a67ec55727e3f:954:27)
    at http
://localhost:3000/packages/iron_router.js?3fb4caf61f2b332b14dabb884ba512baa2663af2:1186:36
    at _
.extend.withValue (http://localhost:3000/packages/meteor.js?61916b1060b33931a21f104fbffb67c2f3d493c5:945:17)
    at hookWithOptions
(http://localhost:3000/packages/iron_router.js?3fb4caf61f2b332b14dabb884ba512baa2663af2:1185:27)
    at boundNext
(http://localhost:3000/packages/iron_middleware-stack.js?87fc6153735b0c669013d562b796bbd57c993d79:406:31)
    at http
://localhost:3000/packages/meteor.js?61916b1060b33931a21f104fbffb67c2f3d493c5:973:22
    at onRerun
(http://localhost:3000/packages/iron_router.js?3fb4caf61f2b332b14dabb884ba512baa2663af2:517:11) debug.js:41
2x Route dispatch never rendered. Did you forget to call this.next() in an onBeforeAction?

I'm not sure what can be wrong.
Has anyone come across this error before? 

Here's how my router.js file looks like
Router.configure({
    layoutTemplate
: 'layout'
});

if(Meteor.isClient) {
 
Router.onBeforeAction(AccountsTemplates.ensureSignedIn, {
   
except: ['homeScreen', 'atSignIn', 'atSignUp', 'atForgotPassword', 'redeemCreditVoucher']
 
});
}

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


Router.route('/redeem/:slug', function() {
   
this.render('redeemVoucher');
});

and my redeemVoucher template
<template name='redeemVoucher'>
 
<div>
   
<h2>This is just a static screen for the redeemVoucher template</h2>

 
</div>

</template>

What may be causing the error above?




Nuno Vidal

unread,
Nov 5, 2014, 5:39:55 AM11/5/14
to meteo...@googlegroups.com
Solved it!


Had update routes definitions in router.js

Router.configure({
    layoutTemplate
: 'layout'
});

if(Meteor.isClient) {
 
Router.onBeforeAction(AccountsTemplates.ensureSignedIn, {
   
except: ['homeScreen', 'atSignIn', 'atSignUp', 'atForgotPassword', 'redeemCreditVoucher']
 
});
}

Router.route('/', {
    name
: 'homeScreen'
});

Router.route('/redeem/:slug', {
    name
: 'redeemVoucher'
});

Reply all
Reply to author
Forward
0 new messages