{"record":{"id":"f1c690ab9197066e","repo":"quarkusio/quarkus","slug":"no-template-matching-the-path-templatepath-could-f1c690","errorCode":null,"errorMessage":"No template matching the path <templatePath> could be found for: <recordClass>","messagePattern":"No template matching the path <templatePath> could be found for: <recordClass>","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":477,"sourceCode":"                if (checkedTemplate != null) {\n                    throw new TemplateException(\n                            String.format(\n                                    \"Multiple checked templates exist for the template path %s:\\n\\t- %s\\n\\t- %s\",\n                                    fullPath, recordClass.name(), checkedTemplate));\n                }\n\n                if (!filePaths.contains(templatePath)\n                        && isNotLocatedByCustomTemplateLocator(locatorPatternsBuildItem.getLocationPatterns(),\n                                templatePath)) {\n                    List<String> startsWith = new ArrayList<>();\n                    for (String filePath : filePaths.getFilePaths()) {\n                        if (filePath.startsWith(templatePath)\n                                && filePath.charAt(templatePath.length()) == '.') {\n                            startsWith.add(filePath);\n                        }\n                    }\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                    }","sourceCodeStart":459,"sourceCodeEnd":495,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/QuteProcessor.java#L459-L495","documentation":"Qute validates at build time that every checked template path corresponds to an existing template file under src/main/resources/templates (or a configured location). When no file path starts with the derived templatePath, collectCheckedTemplates throws this TemplateException naming the class (e.g. a record class used as a template record).","triggerScenarios":"A template record class (or @CheckedTemplate) declares a template path 'items/list' but no file starting with 'items/list.' exists in the templates root; the derived path from package + class name does not match the actual directory layout; the file was deleted/renamed or is in the wrong resources root.","commonSituations":"Package-to-directory mismatch (class io.acme.ItemTemplates expects templates/io/acme/...); typo in file name; template placed in src/test/resources or another module; missing quarkus.qute.template-path-prefix style configuration for custom locations; using custom template locators but forgetting basePath config.","solutions":["Create/rename the template file at the exact expected location, e.g. src/main/resources/templates/items/list.html","Add @CheckedTemplate(basePath=...) or location=... to point at the real file","Check the file lives in src/main/resources/templates of the same module/application, not tests or a dependency","If templates come from a custom TemplateLocator, ensure the build-time validation is satisfied (file present) or the path patterns allow it"],"exampleFix":"// before: record item(record String name) {} in io.acme; templates dir has templates/Item.html\n// after: move file to src/main/resources/templates/io/acme/item.html\n// or: @CheckedTemplate(basePath=\".\") record item(...) {}","handlingStrategy":"validation","validationCode":"// check the expected file exists before build\nString pkg = Templates.class.getPackageName().replace('.', '/');\nPath expected = Path.of(\"src/main/resources/templates\", pkg, \"item.html\");\nif (!Files.exists(expected)) {\n    throw new IllegalStateException(\"Missing checked template: \" + expected);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Mirror the package structure under src/main/resources/templates","Keep template files in the same module as the checked template class","Never place templates only in src/test/resources for production code","Re-derive the path from the error message and create the file at that exact path"],"tags":["qute","build-time","template-not-found","file-missing"],"backgroundTag":"qute-template-not-found","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"}