Solvedmeteor autoform [object Object] Issue with Simple Schema and quickForm

I am not sure why I am getting this error when ever I load in my modal with my quickForm. It just keeps on showing [object Object]. Im assuming that I passed an object and it cant represent it with the label. How can I fix the issue.

HTML users.html

<template name="users">
 <div class="row">
        <div class="col s12" align="right">
            <a class="waves-effect waves-light btn modal-trigger" href="#modal1">Add a User</a>
        </div>
        {{#each users}}
            {{>user}}
        {{/each}}
    </div>
    <div id="modal1" class="modal modal-fixed-footer">
        <div class="modal-content">
            <h4>Add new User</h4>
            {{> quickForm collection="Users" id="insertUserForm" type="insert" class="new-user-form"}}
        </div>
        <div class="modal-footer">
            <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat">
                Close
            </a>
        </div>
    </div>
</template>

JavaScript users.js

import { Mongo } from 'meteor/mongo';
import SimpleSchema from 'simpl-schema';

SimpleSchema.extendOptions(['autoform']);

export const Users = new Mongo.Collection('users');

const UserSchema = new SimpleSchema({
    firstName: {
        type: String,
        label: "First Name",
    },
    lastName: {
        type: String,
        label: "Last Name",
    },
    email: {
        type: String,
        label: "E-Mail",
    },
    createdAt: {
        type: Date,
        autoform: {
            type: 'hidden',
            label: false,
        },
        defaultValue: new Date(),
    },
});

Users.attachSchema( UserSchema );

JavaScript body.js

import { Meteor } from 'meteor/meteor';
import { Template } from 'meteor/templating';
import { Users } from '../api/users';

import './body.html';
import './users.html';

window.Users= Users;

Template.body.onCreated(function bodyOnCreated(){
    Meteor.subscribe('users.allusers');
});

Template.registerHelper('formatDate', function(date){
    return moment(date).format('ll');
});

Template.users.helpers({
    users(){
        return Users.find({});
    },
});

Template.users.onRendered(function(){
    $('#modal1').modal();
});

screenshot from 2018-05-07 12-44-40

18 Answers

✔️Accepted Answer

@cheinle

meteor npm uninstall --save simpl-schema
meteor npm prune
meteor npm install --save simpl-schema@1.4.3

should work

Other Answers:

Same issue here, for me it is coming from the latest version of simpl-schema (1.5.0). When I revert to 1.4.3 the issue goes away. I noticed it's only with quickForms, when I use #autoform it works without issues.

More Issues: