quarkusio/quarkus · error · IllegalStateException

graphql/graphql-client.d.ts not found on classpath

Error message

graphql/graphql-client.d.ts not found on classpath

What it means

SmallRyeGraphQLProcessor.generateJsClient also emits the TypeScript declaration file graphql/graphql-client.d.ts alongside the JS client for the GraphQL UI. If that resource is absent from the extension's classpath, it throws IllegalStateException 'graphql/graphql-client.d.ts not found on classpath'. Like its .js counterpart, this signals inconsistent extension artifacts rather than user code.

Source

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

            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) {
            throw new UncheckedIOException(e);
        }

        Schema schema = schemaBuildItem.getSchema();
        String resolvedPath = httpRootPathBuildItem.resolvePath(graphQLConfig.rootPath());
        String proxyJs = generateGraphQLProxy(schema, resolvedPath);
        staticResourceProducer.produce(
                new GeneratedStaticResourceBuildItem(
                        "/_static/quarkus-graphql-api/graphql-api.js",
                        proxyJs.getBytes(StandardCharsets.UTF_8)));

        String proxyDts = generateGraphQLDeclarations(schema);

View on GitHub (pinned to e1c734241f)

Solutions

  1. Delete ~/.m2/repository/io/quarkus/quarkus-smallrye-graphql* and rebuild with -U to re-download intact artifacts
  2. Run a full ./mvnw clean build to remove stale incremental outputs
  3. Align all Quarkus dependencies to one version via the quarkus-bom import (check mvn dependency:tree for mixed versions)
  4. Disable the GraphQL UI (quarkus.smallrye-graphql.ui.enabled=false) if it is not required
Defensive patterns

Strategy: validation

Validate before calling

// Check both UI client resources exist in the extension jar
String[] required = {"graphql/graphql-client.js", "graphql/graphql-client.d.ts"};
try (JarFile jar = new JarFile(pathToQuarkusSmallryeGraphqlJar)) {
    for (String r : required) {
        if (jar.getEntry(r) == null) throw new IllegalStateException("Missing resource: " + r);
    }
}

Prevention

When it happens

Trigger: Build-time generation of GraphQL UI static resources when the deployment classloader cannot resolve graphql/graphql-client.d.ts — corrupted or partially published quarkus-smallrye-graphql artifacts, version skew between Quarkus modules, or stripped resources in repackaged artifacts.

Common situations: Interruption during a Maven download leaving truncated jars; manually overridden quarkus-smallrye-graphql version against a different Quarkus core; enterprise mirrors/proxies serving incomplete artifacts; stale target/ directories after Quarkus upgrade.

Related errors


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