HandyOrg/HandyControl · warning
Image src can NOT be empty
Error message
Image src can NOT be empty
What it means
The NexT theme's full-image Hexo tag logs a warning via hexo.log.warn when the image source argument is empty. Even with an empty src, the tag still emits an <img> whose src becomes the loading.gif placeholder or an empty string, producing a broken or placeholder image in the rendered post. It is a non-fatal authoring mistake, not an exception.
Solutions
- Add the image path as the first argument of the {% fullimage %} tag in the post source.
- If the path comes from a variable or front-matter field, verify it is non-empty before rendering.
- Check argument quoting: paths with spaces must be quoted so they are not split into separate args.
Example fix
// before
{% fullimage 'lazy' %}
// after
{% fullimage /images/photo.jpg 'lazy' 'Alt text' %} Defensive patterns
Strategy: validation
Validate before calling
function checkFullimageArgs(args) {
const img = args && args[0];
if (!img || !String(img).trim()) {
console.warn('{% fullimage %} requires a non-empty image src as the first argument');
return false;
}
return true;
} Type guard
function hasImageSrc(args) {
return Array.isArray(args) && typeof args[0] === 'string' && args[0].trim().length > 0;
} Prevention
- Always pass the image path as the first argument of {% fullimage %}.
- Quote paths containing spaces so they are not split into multiple args.
- Lint post sources for tag calls with empty argument lists before hexo generate.
When it happens
Trigger: Using {% fullimage %} (or its alias) in a post with no image path argument, e.g. {% fullimage /images/pic.jpg %} typo'd to {% fullimage %} or an unquoted argument containing '@' splits leaving img falsy.
Common situations: Markdown authors pasting the tag syntax incorrectly, forgetting the image URL after the tag name, or a Liquid/Jinja-style template variable that rendered to an empty string inside the tag arguments.
Understand the failure class
Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.
Related errors
- Label text must be defined!
- Tabs block must have unique name!
- URL 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/ef3d562ec2bfa0f8.
Report an issue: GitHub.
Appendix: source
Thrown at doc/themes/next/scripts/tags/full-image.js:19
/**
* full-image.js | https://theme-next.org/docs/tag-plugins/full-image
*/
/* global hexo */
'use strict';
function fullImage(args) {
args = args.join(' ').split(',');
var mixed = args[0].split('@');
var img = mixed[0];
var src = mixed[1] === 'lazy' ? '/images/loading.gif" data-original="' + img : img;
var alt = args[1] || '';
var title = args[2] || '';
var width = args[3] || '';
if (!img) {
hexo.log.warn('Image src can NOT be empty');
}
var image = [`<span itemprop="image" itemscope itemtype="http://schema.org/ImageObject"><img itemprop="url image" src="${src}" class="full-image"`];
alt.length > 0 && image.push(`alt="${alt.trim()}"`);
title.length > 0 && image.push(`title="${title.trim()}"`);
width.length > 0 && image.push(`style="max-width: none; width:${width};"`);
image.push('/><meta itemprop="width" content="auto"/><meta itemprop="height" content="auto"/></span>');
return image.join(' ');
}
hexo.extend.tag.register('fullimage', fullImage, {ends: false});
hexo.extend.tag.register('fi', fullImage, {ends: false});
View on GitHub (pinned to 2c0875ebd6)