{"record":{"id":"e360bd7b3c0bdace","repo":"quarkusio/quarkus","slug":"invalid-component-componentname","errorCode":null,"errorMessage":"Invalid component [${componentName}]","messagePattern":"Invalid component \\[(.+?)\\]","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"extensions/devui/deployment-spi/src/main/java/io/quarkus/devui/spi/page/WebComponentPageBuilder.java","lineNumber":11,"sourceCode":"package io.quarkus.devui.spi.page;\n\npublic class WebComponentPageBuilder extends PageBuilder<WebComponentPageBuilder> {\n\n    protected WebComponentPageBuilder() {\n        super();\n    }\n\n    public WebComponentPageBuilder componentName(String componentName) {\n        if (componentName == null || componentName.isEmpty()) {\n            throw new RuntimeException(\"Invalid component [\" + componentName + \"]\");\n        }\n\n        super.componentName = componentName;\n        return this;\n    }\n\n    public WebComponentPageBuilder componentLink(String componentLink) {\n        if (componentLink == null || componentLink.isEmpty() || !componentLink.endsWith(DOT_JS)) {\n            throw new RuntimeException(\n                    \"Invalid component link [\" + componentLink + \"] - Expeting a link that ends with .js\");\n        }\n\n        super.componentLink = componentLink;\n        return this;\n    }\n}","sourceCodeStart":1,"sourceCodeEnd":27,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/devui/deployment-spi/src/main/java/io/quarkus/devui/spi/page/WebComponentPageBuilder.java#L1-L27","documentation":"WebComponentPageBuilder.componentName() validates the Dev UI web component name before assigning it. If the caller passes null or an empty string, the builder refuses to construct a page with no component name and throws a plain RuntimeException. Web component pages in the Dev UI must have a non-empty name to be registered.","triggerScenarios":"Calling WebComponentPageBuilder.componentName(null) or componentName(\"\") while building a Dev UI web-component page in a deployment build step.","commonSituations":"Extension authors deriving the component name from config, a class name, or a metadata field that turns out to be null or blank at build time.","solutions":["Pass a non-empty component name literal, e.g. componentName(\"my-extension-card\")","Guard/fallback on the derived value before calling componentName(), e.g. name == null ? \"default\" : name","Check the source of the derived name (annotation, config property) is actually populated at build time"],"exampleFix":"// before\npageBuilder.componentName(config.componentName().orElse(null));\n// after\npageBuilder.componentName(config.componentName().orElse(\"my-ext-default\"));","handlingStrategy":"validation","validationCode":"if (name == null || name.isEmpty()) { throw new IllegalStateException(\"component name required\"); }\npageBuilder.componentName(name);","typeGuard":"boolean isValidComponentName(String s) { return s != null && !s.isEmpty(); }","tryCatchPattern":null,"preventionTips":["Never feed config-derived values straight into builder setters; use orElse defaults","Validate build-step inputs early with clear failure messages"],"tags":["devui","builder-validation","build-time"],"backgroundTag":"invalid-builder-argument","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}