apple/pkl · error · IllegalStateException

No stack frame transformer set.

Error message

No stack frame transformer set.

What it means

EvaluatorImpl.build() requires a stack frame transformer: if setStackFrameTransformer was never called, the field is null and building an Evaluator is impossible. It is a mandatory setup step, not an optional customization, so the builder fails fast rather than producing an evaluator with default frame handling.

Solutions

  1. Call setStackFrameTransformer(...) with a non-null transformer before build().
  2. Use StackFrameTransformers.identity() if no transformation is needed.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pkl-core/src/main/java/org/pkl/core/EvaluatorBuilder.java:579 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of apple/pkl@f3efcbfc9b (2026-09-08). Data as JSON: /api/errors/0e9725907c6cd87d. Report an issue: GitHub.

Appendix: source

Thrown at pkl-core/src/main/java/org/pkl/core/EvaluatorBuilder.java:579

        httpClientBuilder.setHeaders(settings.http().headers());
      }
      setHttpClient(httpClientBuilder.buildLazily());
    }

    if (settings.traceMode() != null) {
      setTraceMode(settings.traceMode());
    }

    return this;
  }

  public Evaluator build() {
    if (securityManager == null) {
      securityManager = securityManagerBuilder.build();
    }

    if (stackFrameTransformer == null) {
      throw new IllegalStateException("No stack frame transformer set.");
    }

    return new EvaluatorImpl(
        stackFrameTransformer,
        color,
        securityManager,
        httpClient,
        new LoggerImpl(logger, stackFrameTransformer),
        // copy to shield against subsequent modification through builder
        new ArrayList<>(moduleKeyFactories),
        new ArrayList<>(resourceReaders),
        new HashMap<>(environmentVariables),
        new HashMap<>(externalProperties),
        timeout,
        moduleCacheDir,
        dependencies,
        outputFormat,
        traceMode,

View on GitHub (pinned to f3efcbfc9b)