quarkusio/quarkus · error · IllegalStateException

graphql/graphql-client.js not found on classpath

Error message

graphql/graphql-client.js not found on classpath

What it means

SmallRyeGraphQLProcessor.generateJsClient copies the bundled JavaScript GraphQL client (graphql/graphql-client.js) from the processor's classpath into generated static resources for the GraphQL UI. If the resource cannot be loaded from the TCCL, it throws IllegalStateException 'graphql/graphql-client.js not found on classpath', indicating a broken/partial extension deployment artifact rather than a user code problem.

Source

Thrown at extensions/smallrye-graphql/deployment/src/main/java/io/quarkus/smallrye/graphql/deployment/SmallRyeGraphQLProcessor.java:521

            }
        }
    }

    @BuildStep
    void generateJsClient(
            SmallRyeGraphQLConfig graphQLConfig,
            SmallRyeGraphQLSchemaBuildItem schemaBuildItem,
            HttpRootPathBuildItem httpRootPathBuildItem,
            BuildProducer<GeneratedStaticResourceBuildItem> staticResourceProducer) {

        if (!graphQLConfig.jsClient().enabled()) {
            return;
        }

        ClassLoader tccl = Thread.currentThread().getContextClassLoader();
        try (InputStream is = tccl.getResourceAsStream("graphql/graphql-client.js")) {
            if (is == null) {
                throw new IllegalStateException("graphql/graphql-client.js not found on classpath");
            }
            staticResourceProducer.produce(
                    new GeneratedStaticResourceBuildItem(
                            "/_static/quarkus-graphql/graphql-client.js",
                            IoUtil.readBytes(is)));
        } catch (IOException e) {
            throw new UncheckedIOException(e);
        }

        try (InputStream is = tccl.getResourceAsStream("graphql/graphql-client.d.ts")) {
            if (is == null) {
                throw new IllegalStateException("graphql/graphql-client.d.ts not found on classpath");
            }
            staticResourceProducer.produce(
                    new GeneratedStaticResourceBuildItem(
                            "/_static/quarkus-graphql/graphql-client.d.ts",
                            IoUtil.readBytes(is)));
        } catch (IOException e) {

View on GitHub (pinned to e1c734241f)

Solutions

  1. Clean the local Maven repo entry for io.quarkus:quarkus-smallrye-graphql-* and rebuild (delete ~/.m2/repository/io/quarkus/quarkus-smallrye-graphql*, then ./mvnw clean install -U)
  2. Run ./mvnw clean so stale build outputs from a previous Quarkus version are discarded
  3. Verify all io.quarkus:* dependencies resolve to the same Quarkus version (mvn dependency:tree, align quarkus.platform.version / quarkus-bom)
  4. If the UI is not needed, disable it with quarkus.smallrye-graphql.ui.enabled=false to skip the resource generation
Defensive patterns

Strategy: validation

Validate before calling

// Verify the resource is present in the resolved deployment artifact before building
try (JarFile jar = new JarFile("~/.m2/repository/io/quarkus/quarkus-smallrye-graphql/<v>/quarkus-smallrye-graphql-<v>.jar")) {
    if (jar.getEntry("graphql/graphql-client.js") == null) {
        System.err.println("Corrupted quarkus-smallrye-graphql artifact - re-download");
    }
}

Prevention

When it happens

Trigger: During an application build with the GraphQL UI enabled (quarkus.smallrye-graphql.ui.enabled, default true in dev/test and with UI dependencies present) when the runtime/deployment artifact of the extension is inconsistent — e.g. a partially corrupted local Maven repository, a mismatched quarkus-smallrye-graphql version on the classpath, or a custom build that stripped resources.

Common situations: Corrupted ~/.m2 repository after an interrupted download; mixing quarkus-smallrye-graphql versions via dependencyManagement overrides; shading/repackaging Quarkus deployment artifacts; running an old incremental build output after upgrading Quarkus.

Related errors


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