quarkusio/quarkus · error · IllegalArgumentException

No params to evaluate

Error message

No params to evaluate

What it means

EvaluatedParams.evaluateMessageKey(EvalContext) evaluates the first expression parameter (the message key) of a bundle message method like {msg:key}. It requires at least one parameter; calling it with an empty parameter list throws this IllegalArgumentException.

Source

Thrown at independent-projects/qute/core/src/main/java/io/quarkus/qute/EvaluatedParams.java:67

                asyncResults.add(fu);
                allResults[i++] = Futures.toSupplier(fu);
            }
        }
        CompletionStage<?> cs;
        if (asyncResults == null) {
            cs = failure != null ? failure : CompletedStage.ofVoid();
        } else if (asyncResults.size() == 1) {
            cs = asyncResults.get(0);
        } else {
            cs = CompletableFuture.allOf(asyncResults.toArray(new CompletableFuture[0]));
        }
        return new EvaluatedParams(cs, allResults);
    }

    public static EvaluatedParams evaluateMessageKey(EvalContext context) {
        List<Expression> params = context.getParams();
        if (params.isEmpty()) {
            throw new IllegalArgumentException("No params to evaluate");
        }
        return new EvaluatedParams(context.evaluate(params.get(0)));
    }

    public static EvaluatedParams evaluateMessageParams(EvalContext context) {
        List<Expression> params = context.getParams();
        if (params.size() < 2) {
            return EMPTY;
        } else if (params.size() == 2) {
            return new EvaluatedParams(context.evaluate(params.get(1)));
        }
        Supplier<?>[] allResults = new Supplier[params.size()];
        List<CompletableFuture<?>> asyncResults = null;

        int i = 0;
        CompletedStage<?> failure = null;
        Iterator<Expression> it = params.subList(1, params.size()).iterator();
        while (it.hasNext()) {

View on GitHub (pinned to e1c734241f)

Solutions

  1. Fix the template to pass a message key: {msg:greeting} instead of {msg}
  2. Check that the bundle method declaration matches the template usage (key is required)
  3. In custom code, check context.getParams().isEmpty() before calling evaluateMessageKey

Example fix

// before (template)
{msg}
// after (template)
{msg:hello}
Defensive patterns

Strategy: validation

Validate before calling

List<Expression> params = context.getParams();
if (params.isEmpty()) {
    // fall back or report a clear error before calling evaluateMessageKey
}

Try / catch

try {
    EvaluatedParams p = EvaluatedParams.evaluateMessageKey(context);
} catch (IllegalArgumentException e) {
    throw new TemplateException("Message bundle expression requires a key: {msg:key}");
}

Prevention

When it happens

Trigger: Invoking evaluateMessageKey on an EvalContext whose getParams() is empty — e.g. a message bundle method expression {msg} with no key argument.

Common situations: Typo in a template using a message bundle resolver without a key, a message-bound method invoked with no arguments, or custom extensions reusing evaluateMessageKey for expressions that legitimately have no params.

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


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/a747e367d41c9807. Report an issue: GitHub.