Meteor Accounts.createUser is not a function

888 views Asked by At

Whenever I try to call "Accounts.createUser" (on the client) I get "EXCEPTION: TypeError: Accounts.createUser is not a function".

Accoridng to the documentation it should work "By default, the Accounts.createUser function provided by accounts-password allows you to create an account with a username, email, or both."https://guide.meteor.com/accounts.html#requiring-username-email

I added

    meteor add accounts-base
    meteor add accounts-password

My Code:

    import {Accounts} from 'meteor/accounts-base';


    Accounts.createUser({
        username: 'TestUser01',
        email: '[email protected]',
        password: 'string'
    }, function (err) {
        if (err)
            console.log(err);
        else
            console.log('It worked...');
    });

EDIT: As a info, I want to have it client side. Server side works fine for me.

0

There are 0 answers