Error: Can only call onCreateUser once with Meteor 1.4

Hi,
I’ve upgrade from 1.2 to 1.4 and I have a package that uses accounts-base and accounts-password where I have an onCreateUser.
With the upgrade I’m getting the error ‘Error: Can only call onCreateUser once’ but I only have one onCreateUser in the code.

the code is the following:


import { Accounts } from "meteor/accounts-base";
Accounts.onCreateUser(function(options, user) {
	user.profile = options.profile || {};
       user.started = true;
       return user;
});

Can anyone help me?

Thanks in advance.
Best regards,
Hugo

Hi, is your file located in a server folder? It might be that your folder is client and server.

Hi,
No, its server side only but on a package

did you find a solution to this ?

Hi @Hugo/@Slavrix,

I think even if you have the function in one place it might be running twice. I had the same issue and I moved the function to Meteor.startup.