quarkusio/quarkus · error · RuntimeException

Invalid component link [${componentLink}] - Expeting a link

Error message

Invalid component link [${componentLink}] - Expeting a link that ends with .js

What it means

WebComponentPageBuilder.componentLink() requires the link to the web component's JS bundle to end with '.js' (DOT_JS) and to be non-empty. A null, empty, or non-.js link throws a RuntimeException (note the 'Expeting' typo in the message). The Dev UI loads components as JS modules, so only .js links are accepted.

Source

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

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 link ending exactly in .js, e.g. componentLink("/my-ext/foo-component.js")
  2. Verify the referenced JS file is actually produced/packaged by the extension's build
  3. Strip query strings/fragments before appending the .js path

Example fix

// before
builder.componentLink("components/my-card.ts");
// after
builder.componentLink("components/my-card.js");
Defensive patterns

Strategy: validation

Validate before calling

if (link == null || !link.endsWith(".js")) { throw new IllegalStateException("component link must end with .js: " + link); }
pageBuilder.componentLink(link);

Type guard

boolean isValidJsLink(String s) { return s != null && s.endsWith(".js"); }

Prevention

When it happens

Trigger: Calling componentLink() with null, empty string, or a URL/path not ending in .js, e.g. componentLink("/components/foo.ts") or a missing leading slash plus wrong extension.

Common situations: Pointing at a TS source, a directory, or a bundled asset whose generated filename changed extension; copy-pasting a link with a query string after .js.

Related errors


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