quarkusio/quarkus · error · io.quarkus.qute.TemplateException

Parameter names not recorded for <recordClass>: compile the

Error message

Parameter names not recorded for <recordClass>: compile the class with -parameters

What it means

Template records bind record components to template data by component name, read from the canonical constructor's parameter names in bytecode. If the record class was compiled without -parameters, parameterName(i) returns null and the build fails with this TemplateException. This is the record-based variant of the checked-template parameter-name error.

Source

Thrown at extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/QuteProcessor.java:493

                    }
                    if (startsWith.isEmpty()) {
                        throw new TemplateException(
                                "No template matching the path " + templatePath + " could be found for: "
                                        + recordClass.name());
                    } else {
                        throw new TemplateException(
                                startsWith + " match the path " + templatePath
                                        + " but the file suffix is not configured via the quarkus.qute.suffixes property");
                    }
                }

                Map<String, String> bindings = new HashMap<>();
                List<Type> parameters = canonicalConstructor.parameterTypes();
                for (int i = 0; i < parameters.size(); i++) {
                    Type type = parameters.get(i);
                    String name = canonicalConstructor.parameterName(i);
                    if (name == null) {
                        throw new TemplateException("Parameter names not recorded for " + recordClass.name()
                                + ": compile the class with -parameters");
                    }
                    if (reservedNames.contains(name)) {
                        throw new TemplateException("Template record component [" + name
                                + "] conflicts with an interface method of " + recordInterface);
                    }
                    bindings.put(name, getCheckedTemplateParameterTypeName(type));
                }
                AnnotationValue requireTypeSafeExpressions = checkedTemplateAnnotation != null
                        ? checkedTemplateAnnotation.value(CHECKED_TEMPLATE_REQUIRE_TYPE_SAFE)
                        : null;
                ret.add(new CheckedTemplateBuildItem(templatePath, fragmentId, bindings, null, recordClass,
                        requireTypeSafeExpressions != null ? requireTypeSafeExpressions.asBoolean() : true));
                transformers.produce(new BytecodeTransformerBuildItem(recordClass.name().toString(),
                        new TemplateRecordEnhancer(recordInterface, recordClass, templatePath, fragmentId,
                                canonicalConstructor.descriptor(), canonicalConstructor.parameters(),
                                adaptors.get(recordInterfaceName))));
            }

View on GitHub (pinned to e1c734241f)

Solutions

  1. Compile the module containing the record with -parameters (maven-compiler-plugin <parameters>true</parameters> or Gradle options.parameters = true)
  2. Rebuild/install that module so the application picks up the recompiled classes
  3. If the record is in a third-party JAR, move it into your project or avoid the record-based checked template
  4. Verify with javap -parameters that the record class now records parameter names

Example fix

// before (build.gradle)
// no JavaCompile config
// after
tasks.withType(JavaCompile).configureEach { options.parameters = true }
Defensive patterns

Strategy: validation

Validate before calling

// ensure record components are named in bytecode
// javap -parameters -p target/classes/com/acme/Templates\$item.class
import java.lang.reflect.RecordComponent;
for (RecordComponent rc : item.class.getRecordComponents()) {
    if (rc.getName().startsWith("arg")) {
        throw new IllegalStateException("Recompile with -parameters");
    }
}

Prevention

When it happens

Trigger: A class used as a template record (referenced from a @CheckedTemplate interface method return type) has a canonical constructor with unnamed parameters because its compilation unit lacked the -parameters flag.

Common situations: Records defined in a non-Quarkus-parent Maven module or a separate library JAR compiled without -parameters; annotation processing pipelines that strip MethodParameters; older Gradle setups without options.parameters = true.

Related errors


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