meteor/meteor · error · Error
Accounts.ui.config: Invalid option for `passwordlessSignupFi
Error message
Accounts.ui.config: Invalid option for `passwordlessSignupFields`: ${passwordlessSignupFields} What it means
handlePasswordlessSignupFields rejects any passwordlessSignupFields value that is not a string or an array where every element is one of the allowed values (USERNAME_AND_EMAIL, EMAIL_ONLY). A non-string/non-array value, or an array containing an invalid element, triggers reportInvalid().
Source
Thrown at packages/accounts-ui-unstyled/accounts_ui.js:78
handleRequestPermissions(options);
handleRequestOfflineToken(options);
handleForceApprovalPrompt(options);
};
Meteor.startup(function() {
const settings = Meteor.settings.public?.packages?.['accounts-ui-unstyled'];
if (settings) {
Accounts.ui.config(settings);
}
});
function handlePasswordlessSignupFields(options) {
let { passwordlessSignupFields } = options;
if (passwordlessSignupFields) {
const reportInvalid = () => {
throw new Error(
`Accounts.ui.config: Invalid option for \`passwordlessSignupFields\`: ${passwordlessSignupFields}`
);
};
if (typeof passwordlessSignupFields === 'string') {
passwordlessSignupFields = [passwordlessSignupFields];
} else if (!Array.isArray(passwordlessSignupFields)) {
reportInvalid();
}
if (passwordlessSignupFields.every(isValidPasswordlessSignupField)) {
if (Accounts.ui._options.passwordlessSignupFields) {
throw new Error(
"Accounts.ui.config: Can't set `passwordlessSignupFields` more than once"
);
}
Object.assign(Accounts.ui._options, { passwordlessSignupFields });
return;View on GitHub (pinned to 5076d2f818)
Solutions
- Use only 'USERNAME_AND_EMAIL' or 'EMAIL_ONLY' (string or array of those) for passwordlessSignupFields.
- If the value comes from settings, coerce/validate it to one of the two allowed strings before calling config.
Example fix
// before
Accounts.ui.config({ passwordlessSignupFields: 'USERNAME_ONLY' });
// after
Accounts.ui.config({ passwordlessSignupFields: 'EMAIL_ONLY' }); Defensive patterns
Strategy: validation
Validate before calling
const VALID = new Set(['USERNAME_AND_EMAIL', 'EMAIL_ONLY']);
function validPasswordlessFields(v) {
const arr = Array.isArray(v) ? v : (typeof v === 'string' ? [v] : []);
return arr.length > 0 && arr.every(x => VALID.has(x));
}
if (options.passwordlessSignupFields && !validPasswordlessFields(options.passwordlessSignupFields)) {
delete options.passwordlessSignupFields;
} Type guard
const isValidPasswordlessField = (f) => VALID.has(f);
Prevention
- Remember passwordless only allows USERNAME_AND_EMAIL and EMAIL_ONLY — fewer than password mode.
- Validate settings-derived config before passing to Accounts.ui.config.
When it happens
Trigger: Passing passwordlessSignupFields as a number, object, or boolean; passing an array containing an unknown string like ['USERNAME_ONLY'] (not valid for passwordless); or passing a malformed value from settings.
Common situations: Confusing passwordless field names with password field names (USERNAME_ONLY/USERNAME_AND_OPTIONAL_EMAIL are password-only). Loading config from settings where the field is an object instead of a string. Passing a comma-separated string.
Related errors
- Accounts.ui.config: Invalid option: ${key}
- Accounts.ui.config: Can't set `passwordlessSignupFields` mor
- Accounts.ui.config: Invalid option for `passwordSignupFields
- 400
- Accounts.ui.config: Can't set `passwordSignupFields` more th
AI-assisted analysis of meteor/meteor@5076d2f818 (2026-08-13).
Data as JSON: /api/errors/f963d96aa1e4e85d.
Report an issue: GitHub.