{"record":{"id":"d5158e9fa33d1bdc","repo":"quarkusio/quarkus","slug":"templates-that-are-not-backed-by-a-file-must-provi","errorCode":null,"errorMessage":"Templates that are not backed by a file must provide extension info","messagePattern":"Templates that are not backed by a file must provide extension info","errorType":"exception","errorClass":"java.lang.IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/TemplatePathBuildItem.java","lineNumber":270,"sourceCode":"        public Builder priority(int priority) {\n            this.priority = priority;\n            return this;\n        }\n\n        /**\n         * Set the parser config for the template.\n         *\n         * @param parserConfig\n         * @return self\n         */\n        public Builder parserConfig(ParserConfig parserConfig) {\n            this.parserConfig = parserConfig;\n            return this;\n        }\n\n        public TemplatePathBuildItem build() {\n            if (fullPath == null && extensionInfo == null) {\n                throw new IllegalStateException(\"Templates that are not backed by a file must provide extension info\");\n            }\n            return new TemplatePathBuildItem(path, content, fullPath, extensionInfo, priority, source, parserConfig);\n        }\n\n    }\n\n}\n","sourceCodeStart":252,"sourceCodeEnd":278,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/TemplatePathBuildItem.java#L252-L278","documentation":"TemplatePathBuildItem.Builder.build() validates that a template entry is either backed by a real file (fullPath set) or carries extension info identifying which extension provides it. Content-based templates without a file path must declare extensionInfo so the template can be attributed and resolved; otherwise IllegalStateException is thrown at build time.","triggerScenarios":"A custom build step creates a TemplatePathBuildItem with TemplatePathBuildItem.builder().content(...) but never calls extensionInfo(...) on the builder, then invokes build().","commonSituations":"Extension authors synthesizing templates from annotation data or generated content and forgetting the extensionInfo builder method; upgrading Qute where the builder gained this stricter check.","solutions":["Call .extensionInfo(\"your-extension\") on the TemplatePathBuildItem.Builder before build()","Or provide a real file-backed path via .fullPath(...) instead of inline content","Check which custom build step produces the item and add the missing builder call"],"exampleFix":"// before\nTemplatePathBuildItem.builder().content(\"...content...\").build();\n// after\nTemplatePathBuildItem.builder().content(\"...content...\").extensionInfo(\"my-extension\").build();","handlingStrategy":"validation","validationCode":"TemplatePathBuildItem.Builder b = TemplatePathBuildItem.builder().content(templateContent);\nif (fullPath == null && extensionInfo == null) {\n    b.extensionInfo(\"my-extension\");\n}\nTemplatePathBuildItem item = b.build();","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set extensionInfo when building content-based (non-file) templates","Add a unit test invoking your build step that catches IllegalStateException from build()","Review builder calls for completeness whenever TemplatePathBuildItem's builder API changes"],"tags":["qute","build-time","template","builder-validation"],"backgroundTag":"missing-required-build-item-field","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"}