HandyOrg/HandyControl · warning
Label text must be defined!
Error message
Label text must be defined!
What it means
The NexT theme's label Hexo tag splits its arguments on '@' into a class and a text part, and warns when the text (the part after '@') is empty. The tag still renders an empty <span class="label ..."></span>. It signals a malformed tag call, not a hard failure.
Solutions
- Write the label as {% label class @ text %}, e.g. {% label primary @ Important %}.
- Ensure the '@' separator is present and followed by the label text.
- If you want the default class, start the argument with '@': {% label @ My text %}.
Example fix
// before
{% label primary %}
// after
{% label primary @ Important note %} Defensive patterns
Strategy: validation
Validate before calling
function checkLabelArgs(rawArgs) {
const parts = rawArgs.join(' ').split('@');
const text = parts[1];
if (!text || !text.trim()) {
console.warn('{% label %} requires text after "@", e.g. {% label primary @ text %}');
return false;
}
return true;
} Type guard
function hasLabelText(args) {
const parts = args.join(' ').split('@');
return typeof parts[1] === 'string' && parts[1].trim().length > 0;
} Prevention
- Always use the {% label class @ text %} form with the '@' separator.
- Never leave the text after '@' empty.
- Grep post sources for `label %}` calls lacking '@' in a pre-build check.
When it happens
Trigger: {% label @some text %} (no class given, and text contains no further '@') is fine, but writing {% label primary %} — where '@' is missing so args[1] is undefined — or {% label primary @ %} with nothing after '@' triggers the warning.
Common situations: Authors forgetting the '@' separator between label color class and text, or copying an example where the class was omitted leaving only one argument.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- Tabs block must have unique name!
- URL can NOT be empty
- Image src can NOT be empty
- WARNING: `exturl` and `extlink` tag will not longer be…
- Include file empty.
AI-assisted analysis of HandyOrg/HandyControl@2c0875ebd6 (2026-09-14).
Data as JSON: /api/errors/ace6c5a78a378830.
Report an issue: GitHub.
Appendix: source
Thrown at doc/themes/next/scripts/tags/label.js:14
/**
* label.js | https://theme-next.org/docs/tag-plugins/label
*/
/* global hexo */
'use strict';
function postLabel(args) {
args = args.join(' ').split('@');
var classes = args[0] || 'default';
var text = args[1] || '';
!text && hexo.log.warn('Label text must be defined!');
return `<span class="label ${classes.trim()}">${text}</span>`;
}
hexo.extend.tag.register('label', postLabel, {ends: false});
View on GitHub (pinned to 2c0875ebd6)