{"record":{"id":"c36b242535f6eb73","repo":"quarkusio/quarkus","slug":"parameter-names-not-recorded-for-recordclass-co","errorCode":null,"errorMessage":"Parameter names not recorded for <recordClass>: compile the class with -parameters","messagePattern":"Parameter names not recorded for <recordClass>: compile the class with -parameters","errorType":"exception","errorClass":"io.quarkus.qute.TemplateException","httpStatus":null,"severity":"error","filePath":"extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/QuteProcessor.java","lineNumber":493,"sourceCode":"                    }\n                    if (startsWith.isEmpty()) {\n                        throw new TemplateException(\n                                \"No template matching the path \" + templatePath + \" could be found for: \"\n                                        + recordClass.name());\n                    } else {\n                        throw new TemplateException(\n                                startsWith + \" match the path \" + templatePath\n                                        + \" but the file suffix is not configured via the quarkus.qute.suffixes property\");\n                    }\n                }\n\n                Map<String, String> bindings = new HashMap<>();\n                List<Type> parameters = canonicalConstructor.parameterTypes();\n                for (int i = 0; i < parameters.size(); i++) {\n                    Type type = parameters.get(i);\n                    String name = canonicalConstructor.parameterName(i);\n                    if (name == null) {\n                        throw new TemplateException(\"Parameter names not recorded for \" + recordClass.name()\n                                + \": compile the class with -parameters\");\n                    }\n                    if (reservedNames.contains(name)) {\n                        throw new TemplateException(\"Template record component [\" + name\n                                + \"] conflicts with an interface method of \" + recordInterface);\n                    }\n                    bindings.put(name, getCheckedTemplateParameterTypeName(type));\n                }\n                AnnotationValue requireTypeSafeExpressions = checkedTemplateAnnotation != null\n                        ? checkedTemplateAnnotation.value(CHECKED_TEMPLATE_REQUIRE_TYPE_SAFE)\n                        : null;\n                ret.add(new CheckedTemplateBuildItem(templatePath, fragmentId, bindings, null, recordClass,\n                        requireTypeSafeExpressions != null ? requireTypeSafeExpressions.asBoolean() : true));\n                transformers.produce(new BytecodeTransformerBuildItem(recordClass.name().toString(),\n                        new TemplateRecordEnhancer(recordInterface, recordClass, templatePath, fragmentId,\n                                canonicalConstructor.descriptor(), canonicalConstructor.parameters(),\n                                adaptors.get(recordInterfaceName))));\n            }","sourceCodeStart":475,"sourceCodeEnd":511,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/QuteProcessor.java#L475-L511","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Compile the module containing the record with -parameters (maven-compiler-plugin <parameters>true</parameters> or Gradle options.parameters = true)","Rebuild/install that module so the application picks up the recompiled classes","If the record is in a third-party JAR, move it into your project or avoid the record-based checked template","Verify with javap -parameters that the record class now records parameter names"],"exampleFix":"// before (build.gradle)\n// no JavaCompile config\n// after\ntasks.withType(JavaCompile).configureEach { options.parameters = true }","handlingStrategy":"validation","validationCode":"// ensure record components are named in bytecode\n// javap -parameters -p target/classes/com/acme/Templates\\$item.class\nimport java.lang.reflect.RecordComponent;\nfor (RecordComponent rc : item.class.getRecordComponents()) {\n    if (rc.getName().startsWith(\"arg\")) {\n        throw new IllegalStateException(\"Recompile with -parameters\");\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Enable -parameters in every module that declares template records","Do not consume template records from JARs built without -parameters","Rebuild dependent modules after changing compiler flags","Keep records in the application module where Quarkus controls compilation"],"tags":["qute","build-time","records","compiler"],"backgroundTag":"missing-parameters-compiler-flag","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}