quarkusio/quarkus · error

Index parameter is missing

Error message

Index parameter is missing

What it means

Qute's ArrayResolver resolves array access in templates via methods like `get(index)`. It throws this IllegalArgumentException when a `get` call is made on an array base value without supplying the required index parameter. The resolver requires exactly one parameter that evaluates to an Integer.

Source

Thrown at independent-projects/qute/core/src/main/java/io/quarkus/qute/ValueResolvers.java:444

                }
                Expression indexExpr = context.getParams().get(0);
                if (indexExpr.isLiteral()) {
                    Object literalValue = indexExpr.getLiteral();
                    if (literalValue instanceof Integer) {
                        return CompletedStage.of(takeLastArray((Integer) literalValue, context.getBase()));
                    }
                    return Results.notFound(context);
                } else {
                    return context.evaluate(indexExpr).thenCompose(n -> {
                        if (n instanceof Integer) {
                            return CompletedStage.of(takeLastArray((Integer) n, context.getBase()));
                        }
                        return Results.notFound(context);
                    });
                }
            } else if (name.equals(GET)) {
                if (context.getParams().isEmpty()) {
                    throw new IllegalArgumentException("Index parameter is missing");
                }
                Expression indexExpr = context.getParams().get(0);
                if (indexExpr.isLiteral()) {
                    Object literalValue = indexExpr.getLiteral();
                    if (literalValue instanceof Integer) {
                        return CompletedStage.of(Array.get(context.getBase(), (Integer) literalValue));
                    }
                    return Results.notFound(context);
                } else {
                    return context.evaluate(indexExpr).thenCompose(idx -> {
                        if (idx instanceof Integer) {
                            return CompletedStage.of(Array.get(context.getBase(), (Integer) idx));
                        }
                        return Results.notFound(context);
                    });
                }
            } else {
                // Try to use the name as an index

View on GitHub (pinned to e1c734241f)

Solutions

  1. Supply the index parameter in the template: use `{myArray.get(0)}` or `{myArray.get(i)}`.
  2. Use bracket/property index syntax instead: `{myArray.0}` or `{myArray[i]}` for loops over indices.
  3. Guard with `{#if myArray.size > 0}` before calling get to ensure valid access.

Example fix

// before (template)
{myArray.get}
// after (template)
{myArray.get(0)}
Defensive patterns

Strategy: validation

Validate before calling

// Java check before rendering
if (array == null) throw new IllegalArgumentException("array data missing");
// in template, prefer guarded form:
// {#if index >= 0 && index < array.length}{array.get(index)}{/if}

Prevention

When it happens

Trigger: A template expression on an array base value uses `get` with no parameter, e.g. `{myArray.get}` instead of `{myArray.get(0)}`, and `context.getParams().isEmpty()` is true in ArrayResolver.resolve at ValueResolvers.java:444.

Common situations: Template typos where parentheses/index were dropped; generating templates dynamically and forgetting to interpolate the index; refactoring `{myArray.0}` into `{myArray.get}` without adding the index 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


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