forem/forem · error · StandardError
Tags option requires at least one tag name
Error message
Tags option requires at least one tag name
What it means
The tags= option of the feed tag accepts a comma-separated list. parse_tags splits on commas, strips whitespace, rejects empty strings, and raises when the resulting array is empty. This guards against a tags= key that carries no usable tag name. Note that a list with at least one non-empty entry is fine — only lists that are empty after cleaning raise.
Source
Thrown at app/liquid_tags/feed_tag.rb:65
end
def validate_source
raise StandardError, I18n.t("liquid_tags.feed_tag.missing_source") if @org_slug.nil? && @tag_names.empty?
end
def parse_org(value)
@org_slug = value
@organization = Organization.find_by_slug_or_legacy(@org_slug)
raise StandardError, I18n.t("liquid_tags.feed_tag.invalid_org", slug: @org_slug) unless @organization
end
def parse_tag(value)
@tag_names = [value]
end
def parse_tags(value)
names = value.split(",").map(&:strip).reject(&:empty?)
raise StandardError, I18n.t("liquid_tags.feed_tag.invalid_tags") if names.empty?
@tag_names = names
end
def parse_limit(value)
@limit = Integer(value, exception: false)
unless @limit && @limit >= 1 && @limit <= MAX_LIMIT
raise StandardError, I18n.t("liquid_tags.feed_tag.invalid_limit")
end
end
def parse_sort(value)
unless VALID_SORTS.include?(value)
raise StandardError, I18n.t("liquid_tags.feed_tag.invalid_sort")
end
@sort = value
endView on GitHub (pinned to f354c376a7)
Solutions
- Provide at least one tag name: {% feed tags=ruby,rails %}.
- If you only need one tag, use the singular form {% feed tag=ruby %} which cannot hit this error.
- Remove the tags= token entirely if you meant to source from an org only ({% feed org=<slug> %}).
Example fix
// before
{% feed tags=,, %}
// after
{% feed tags=javascript,ruby %} Defensive patterns
Strategy: validation
Validate before calling
value = input[/\btags=([^\s]+)/, 1]
valid = value.nil? || value.split(',').map(&:strip).reject(&:empty?).any? Type guard
def feed_tags_present?(input)
value = input[/\btags=([^\s]+)/, 1]
value.nil? || value.split(',').any? { |n| n.strip.match?(/\S/) }
end Try / catch
begin
FeedTag.new("feed", input, Liquid::ParseContext.new)
rescue StandardError => e
flash.now[:error] = e.message # re-show the editor
end Prevention
- Trim trailing commas when generating tags= lists programmatically.
- Prefer tag= for single-tag feeds.
- Preview-render drafts before publishing.
When it happens
Trigger: {% feed tags=,,, %}; {% feed tags=, , %} (only commas and spaces); {% feed tags=%} where the value got dropped by the option regexp; a paste artifact that leaves only separators.
Common situations: Author deletes the last tag name but leaves the trailing commas; author thinks tags= with no value disables the option; option formatting confused with tag= (single) vs tags= (list).
Understand the failure class
Background: Missing required parameter errors: what 'X is required' and 'the required X param is missing' mean, and how to fix them — this error's family across 27 libraries.
Related errors
- Feed tag requires at least one source: org, tag, or tags
- Limit must be between 1 and 30
- Sort must be one of: recent, reactions, comments, score
- Since must be a relative duration (e.g. 30d) or date (YYYY-M
- Invalid Gist link: You must provide a Gist link
AI-assisted analysis of forem/forem@f354c376a7 (2026-08-21).
Data as JSON: /api/errors/880bf6835292bbd8.
Report an issue: GitHub.