quarkusio/quarkus · error · TemplateException
Missing required data: {" + expression.toOriginalString() +
Error message
Missing required data: {" + expression.toOriginalString() + "} What it means
QuteCodestartFileReader installs a fallback value resolver for expressions not resolved from the provided data. Except for the special 'merged-content' marker, any unresolved expression makes rendering fail with this TemplateException. It guarantees templates only reference data actually supplied at generation time.
Source
Thrown at independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/core/reader/QuteCodestartFileReader.java:148
}
@Override
public Optional<Variant> getVariant() {
return Optional.empty();
}
}
static class MissingValueMapper implements ResultMapper {
public boolean appliesTo(TemplateNode.Origin origin, Object result) {
return Results.isNotFound(result);
}
public String map(Object result, Expression expression) {
if (expression.toOriginalString().equals("merged-content")) {
return "{merged-content}";
}
throw new TemplateException("Missing required data: {" + expression.toOriginalString() + "}");
}
}
/**
* private static CompletionStage<Object> replaceResolveAsync(EvalContext context) {
* String text = (String) context.getBase();
* switch (context.getName()) {
* case "replace":
* if (context.getParams().size() == 2) {
* return context.evaluate(context.getParams().get(0)).thenCombine(context.evaluate(context.getParams().get(1)),
* (r1, r2) -> CompletableFuture.completedFuture(text.replace(r1.toString(), r2.toString())));
* }
* default:
* return Results.NOT_FOUND;
* }
* }
**/
View on GitHub (pinned to e1c734241f)
Solutions
- Add the missing key/value to the data map passed to project generation
- Correct the expression in the template to match an existing data key
- Provide an inline default in the template: {myKey ?: 'fallback'}
Example fix
// before
Map.of("name", projectName) // template uses {groupId}
// after
Map.of("name", projectName, "groupId", groupId) Defensive patterns
Strategy: validation
Validate before calling
// verify all {expr} tokens in templates are covered by data keys or '?:' defaults Try / catch
try { generate.generateProject(dir, data); }
catch (Exception e) {
if (e.getMessage() != null && e.getMessage().startsWith("Missing required data:")) { /* add key, retry */ }
else throw e;
} Prevention
- Sync data map with template expressions
- Use '?:' defaults for optional keys
- Unit-test rendering with documented data
When it happens
Trigger: Rendering a codestart Qute template that references {someExpression} not present in the generation data map and not defaulted with '?:' — the no-data fallback resolver throws for it.
Common situations: Typo in a data key inside the template; codestart data map missing a key the template expects; relying on Qute's null-value default behavior which this reader intentionally disables.
Related errors
- Error while rendering template: + source.absolutePath()
- Unable to render config roots for top level prefix: ${topLev
- Unable to render config roots for specific file: ${fileName}
- Unable to render config section for section: ${section} in e
- Unable to render all config
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/d63a856a2a8357e4.
Report an issue: GitHub.