javascript - Meteor 0.8.0 update throws out a "non function" error - Stack Overflow

After the Meteor update to 0.8.0 I had some issues with iron-router, but I was able to fix them by addi

After the Meteor update to 0.8.0 I had some issues with iron-router, but I was able to fix them by adding the blade-layout package and updating iron-router...

However, now I get the following error in the browser console, (the normal console doesn't throw out any errors, just tells me app is running at localhost:3000).

This is the error I get in the browser console when I try to visit the home page. This only started happening after I updated to Meteor 0.8.0

Exception in defer callback: Error: Can't call non-function: [object Object]
    at Spacebars.call (http://localhost:3000/packages/spacebars.js?5d478ab1c940b6f5a88f78b8adc81a47f022da77:176:13)
    at Spacebars.mustacheImpl (http://localhost:3000/packages/spacebars.js?5d478ab1c940b6f5a88f78b8adc81a47f022da77:110:25)
    at Object.Spacebars.mustache (http://localhost:3000/packages/spacebars.js?5d478ab1c940b6f5a88f78b8adc81a47f022da77:114:39)
    at Template.__define__.HTML.DIV.class (http://localhost:3000/client/html/template.page_layout.js?b9f71b600d93464d684baf69d25d5f1c78c77785:6:22)
    at http://localhost:3000/packages/ui.js?b523ef986d3d39671bcb40319d0df8982acacfe8:2299:21
    at callWithNoYieldsAllowed (http://localhost:3000/packages/deps.js?7afb832ce6e6c89421fa70dc066201f16f9b9105:74:5)
    at _.extend._pute (http://localhost:3000/packages/deps.js?7afb832ce6e6c89421fa70dc066201f16f9b9105:212:7)
    at new Deps.Computation (http://localhost:3000/packages/deps.js?7afb832ce6e6c89421fa70dc066201f16f9b9105:144:10)
    at Object._.extend.autorun (http://localhost:3000/packages/deps.js?7afb832ce6e6c89421fa70dc066201f16f9b9105:361:13)
    at materialize (http://localhost:3000/packages/ui.js?b523ef986d3d39671bcb40319d0df8982acacfe8:2298:29) debug.js:41

If anyone else has experienced this error, please let me know what it means with a possible solution.

I appreciate the help.

After the Meteor update to 0.8.0 I had some issues with iron-router, but I was able to fix them by adding the blade-layout package and updating iron-router...

However, now I get the following error in the browser console, (the normal console doesn't throw out any errors, just tells me app is running at localhost:3000).

This is the error I get in the browser console when I try to visit the home page. This only started happening after I updated to Meteor 0.8.0

Exception in defer callback: Error: Can't call non-function: [object Object]
    at Spacebars.call (http://localhost:3000/packages/spacebars.js?5d478ab1c940b6f5a88f78b8adc81a47f022da77:176:13)
    at Spacebars.mustacheImpl (http://localhost:3000/packages/spacebars.js?5d478ab1c940b6f5a88f78b8adc81a47f022da77:110:25)
    at Object.Spacebars.mustache (http://localhost:3000/packages/spacebars.js?5d478ab1c940b6f5a88f78b8adc81a47f022da77:114:39)
    at Template.__define__.HTML.DIV.class (http://localhost:3000/client/html/template.page_layout.js?b9f71b600d93464d684baf69d25d5f1c78c77785:6:22)
    at http://localhost:3000/packages/ui.js?b523ef986d3d39671bcb40319d0df8982acacfe8:2299:21
    at callWithNoYieldsAllowed (http://localhost:3000/packages/deps.js?7afb832ce6e6c89421fa70dc066201f16f9b9105:74:5)
    at _.extend._pute (http://localhost:3000/packages/deps.js?7afb832ce6e6c89421fa70dc066201f16f9b9105:212:7)
    at new Deps.Computation (http://localhost:3000/packages/deps.js?7afb832ce6e6c89421fa70dc066201f16f9b9105:144:10)
    at Object._.extend.autorun (http://localhost:3000/packages/deps.js?7afb832ce6e6c89421fa70dc066201f16f9b9105:361:13)
    at materialize (http://localhost:3000/packages/ui.js?b523ef986d3d39671bcb40319d0df8982acacfe8:2298:29) debug.js:41

If anyone else has experienced this error, please let me know what it means with a possible solution.

I appreciate the help.

Share Improve this question asked Mar 28, 2014 at 4:59 user1952811user1952811 2,4686 gold badges33 silver badges49 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 10

you have a line there which says where is the error

 at Template.__define__.HTML.DIV.class (http://localhost:3000/client/html/template.page_layout.js?b9f71b600d93464d684baf69d25d5f1c78c77785:6:22)

You should use the blaze-layout and change the yield tags inside of a layout template

the old way {{yield}} or {{yield 'footer'}}

a new way {{> yield}} {{> yield region="footer"}}

https://github./EventedMind/blaze-layout

Alternative cause

Template

<template name="answer">
        <li class="answer-title">
            {{answer .. this}}
        </li>   
</template>

When answer is not a helper function the error Can't call non-function is thrown, becaue this syntax is only for calling helpers and passing them parameters. Ie. When answers is:

Templates.answer.helpers({
   answer: function (parentCtx, self) { return self.batman ^ !parentCtx; }
});

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742387072a4434273.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信