quarkusio/quarkus · error · TemplateException
Unsupported param type:
Error message
Unsupported param type:
What it means
While building the condition tree for an {#if} section, createCondition accepts only String params (single operands), List params (composite groups), and Booleans (literal true/false). Any other parameter type reaching this point cannot become a condition, so TemplateException is thrown. Normally unreachable from templates; it guards internal parser invariants.
Source
Thrown at independent-projects/qute/core/src/main/java/io/quarkus/qute/IfSectionHelper.java:767
for (Object p : params) {
if (p instanceof Operator) {
nextOperator = (Operator) p;
} else {
conditions.add(createCondition(p, block, nextOperator, context));
nextOperator = null;
}
}
if (operator == null && conditions.size() == 1) {
condition = conditions.get(0);
} else if (conditions.size() == 2) {
condition = new DoubletonCondition(conditions.get(0), conditions.get(1), operator);
} else {
condition = new CompositeCondition(operator, ImmutableList.copyOf(conditions));
}
} else {
throw new TemplateException("Unsupported param type: " + param);
}
return condition;
}
enum Code implements ErrorCode {
/**
* <code>{#if foo >}{/}</code>
*/
BINARY_OPERATOR_MISSING_SECOND_OPERAND,
;
@Override
public String getName() {
return "IF_" + name();
}
View on GitHub (pinned to e1c734241f)
Solutions
- Ensure params passed into the if-section machinery are only Strings, Lists (from composite parsing), or Booleans
- If you write custom section-helper/param code, convert unsupported values to String or Boolean before calling createCondition
- Check the Quarkus version for a known bug and report with a reproducer if a stock template triggers it
Example fix
// before Object param = someCustomParse(...); // e.g. Integer 42 condition = IfSectionHelper.createCondition(param, block, operator, context); // throws // after condition = IfSectionHelper.createCondition(param instanceof Integer i ? i.toString() : param, block, operator, context);
Defensive patterns
Strategy: type-guard
Validate before calling
// before building conditions, restrict param types
if (!(param instanceof String || param instanceof List || param instanceof Boolean)) {
throw new IllegalArgumentException("Unsupported param: " + param.getClass());
} Type guard
boolean isSupportedParam(Object p) {
return p instanceof String || p instanceof List || p instanceof Boolean;
} Try / catch
try {
condition = createCondition(param, block, operator, context);
} catch (TemplateException e) {
if (e.getMessage().startsWith("Unsupported param type")) {
throw new IllegalStateException("Bad param " + param.getClass() + "; expected String/List/Boolean", e);
}
throw e;
} Prevention
- Only feed String, List, or Boolean params into if-section helpers
- Convert custom parsed values to String/Boolean before condition construction
- Pin to released Quarkus versions
When it happens
Trigger: Passing an object of an unexpected type (neither String, List, nor Boolean) into the package-private createCondition method — usually from custom code composing section params or a framework bug where a parsed param kept an unhandled type.
Common situations: Custom Qute patches or third-party template tooling that constructs if-section parameters directly; otherwise effectively never seen by end users.
Related errors
- Not a binary operator:
- Not a short-circuiting operator:
- Invalid composite parameter found:
- Expression not found for param []:
- Invalid template link [${templateLink}] - Expeting a link th
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/4394cedb061b8191.
Report an issue: GitHub.