Uncaught RangeError: Maximum call stack size exceeded in meteor autoform

535 views Asked by At

This is a very simple application. I do not know why I am getting "Uncaught RangeError: Maximum call stack size exceeded".

In folder called 'both', I have a JS file with schema defined as follows

Schema1 = new SimpleSchema({
    name:{
        type:String,
        label:'Name'
    }
});

In client folder, Now I have an HTML template as shown:

<template name="test">
    {{#autoForm schema="Schema1" id = "schema1" type="method-update" meteormethod="processInServer" doc=formDoc}}
        {{> afQuickField name='name'}}
        <button type="insert">Update</button>
    {{/autoForm}}
</template>

The helpers of the above template is as follows:

Template.test.helpers({
    formDoc:function(){
        return 'avishek';
    }
})

var hook = {
    before:{
        method:function(doc){
            console.log(doc);
            return doc;
        }
    }
}

AutoForm.addHooks(['schema1'],hook);

In server folder,

Meteor.methods({
    'processInServer': function () {
        console.log('called server');
        return 'success';
    }
})

What could go wrong in this application. I have nothing apart from this.

1

There are 1 answers

0
AudioBubble On

I got it guys. The helper must have _id attribute

Template.test.helpers({
    formDoc:function(){
        return {'_id':'acbde1222','name':'avishek'};
    }
})