quarkusio/quarkus · error · RuntimeException

Invalid component [${componentName}]

Error message

Invalid component [${componentName}]

What it means

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.

Source

Thrown at extensions/devui/deployment-spi/src/main/java/io/quarkus/devui/spi/page/WebComponentPageBuilder.java:11

package io.quarkus.devui.spi.page;

public class WebComponentPageBuilder extends PageBuilder<WebComponentPageBuilder> {

    protected WebComponentPageBuilder() {
        super();
    }

    public WebComponentPageBuilder componentName(String componentName) {
        if (componentName == null || componentName.isEmpty()) {
            throw new RuntimeException("Invalid component [" + componentName + "]");
        }

        super.componentName = componentName;
        return this;
    }

    public WebComponentPageBuilder componentLink(String componentLink) {
        if (componentLink == null || componentLink.isEmpty() || !componentLink.endsWith(DOT_JS)) {
            throw new RuntimeException(
                    "Invalid component link [" + componentLink + "] - Expeting a link that ends with .js");
        }

        super.componentLink = componentLink;
        return this;
    }
}

View on GitHub (pinned to e1c734241f)

Solutions

  1. Pass a non-empty component name literal, e.g. componentName("my-extension-card")
  2. Guard/fallback on the derived value before calling componentName(), e.g. name == null ? "default" : name
  3. Check the source of the derived name (annotation, config property) is actually populated at build time

Example fix

// before
pageBuilder.componentName(config.componentName().orElse(null));
// after
pageBuilder.componentName(config.componentName().orElse("my-ext-default"));
Defensive patterns

Strategy: validation

Validate before calling

if (name == null || name.isEmpty()) { throw new IllegalStateException("component name required"); }
pageBuilder.componentName(name);

Type guard

boolean isValidComponentName(String s) { return s != null && !s.isEmpty(); }

Prevention

When it happens

Trigger: Calling WebComponentPageBuilder.componentName(null) or componentName("") while building a Dev UI web-component page in a deployment build step.

Common situations: 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.

Related errors


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