octobercms/october · error · Error
Snackbar options.action.label must be a string
Error message
Snackbar options.action.label must be a string
What it means
Type guard in the Snackbar's validateOptions helper: when an action object is supplied, its label property must be the string shown on the action button; a non-string label (number, undefined, object) triggers this throw.
Solutions
- Provide a string label on the action object
- Check that the label isn't undefined/null or a translated object
Defensive patterns
Strategy: type-guard
When it happens
Trigger: Thrown at modules/backend/assets/js/october/october.snackbar.js:56 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21).
Data as JSON: /api/errors/b8de8438c730ecba.
Report an issue: GitHub.
Appendix: source
Thrown at modules/backend/assets/js/october/october.snackbar.js:56
throw new Error('Snackbar options.timeout must be a number');
}
if (options.timeout < 2000) {
throw new Error('Snackbar options.timeout cannot be lower than 2000');
}
if (options.timeout > 8000) {
throw new Error('Snackbar options.timeout cannot be higher than 8000');
}
}
if (options.action !== undefined) {
if (typeof options.action !== 'object') {
throw new Error('Snackbar options.action must be an object');
}
if (typeof options.action.label !== 'string') {
throw new Error('Snackbar options.action.label must be a string');
}
if (typeof options.action.callback !== 'function') {
throw new Error('Snackbar options.action.callback must be a function');
}
}
}
function runQueue() {
if (displayedMessage !== null) {
return;
}
var parameters = queue.shift();
if (parameters === undefined) {
return;
}
View on GitHub (pinned to b608633a7e)