Here is sample code from the Mv3 docs for Accounts.onCreateUser :
Accounts.onCreateUser((options, user) => {
const customizedUser = Object.assign(
{
dexterity: _.random(1, 6) + _.random(1, 6) + _.random(1, 6),
},
user
);
// We still want the default hook's 'profile' behavior.
if (options.profile) {
customizedUser.profile = options.profile;
}
return customizedUser;
});
Running it as-is throws an error:
Exception while invoking method ‘createUser’ TypeError: Promise.await is not a function