apple/pkl · error · VmException
inlineNotSupportedHere
inlineNotSupportedHere
Error message
inlineNotSupportedHere
What it means
While rendering XML, a `Typed` object recognized as an inline XML value (satisfies `isXmlInline`) appeared where the renderer cannot emit it. The renderer throws instead of producing malformed output.
Source
Thrown at pkl-core/src/main/java/org/pkl/core/stdlib/xml/RendererNodes.java:193
@Override
public void visitIntSeq(VmIntSeq value) {
cannotRenderTypeAddConverter(value);
}
@Override
protected void startDynamic(VmDynamic value) {
if (isXmlElement(value)) {
throw new VmExceptionBuilder()
.evalError("elementNotSupportedHere")
.withProgramValue("Value", value)
.build();
}
}
@Override
public void startTyped(VmTyped value) {
if (isXmlInline(value)) {
throw new VmExceptionBuilder()
.evalError("inlineNotSupportedHere")
.withProgramValue("Value", value)
.build();
}
}
// No-op for XML
@Override
protected void startListing(VmListing value) {}
// No-op for XML
@Override
protected void startMapping(VmMapping value) {}
// No-op for XML
@Override
protected void startList(VmList value) {}
View on GitHub (pinned to f3efcbfc9b)
Solutions
- Place the inline value where the renderer accepts it (inside element content)
- Convert the inline node to a regular XmlElement-shaped Dynamic object
- Render the value to a string first if only text is allowed at that position
- Verify you are using the intended XML rendering entry point from pkl-xml
Example fix
// before
attr = xmlInline("...") // inline value in attribute slot
// after
content { xmlInline("...") } Defensive patterns
Strategy: validation
Validate before calling
function isInline(v: Any): Boolean = v is Typed && v.hasClassProperty("xmlInline") // adapt to pkl-xml API Type guard
function renderableHere(v: Any): Boolean = !(v is Typed) || !isXmlInlineValue(v)
Prevention
- Use pkl-xml's documented element/inline APIs rather than mixing them ad hoc
- Keep inline nodes inside element content
- Check renderer entry points before custom XML output
When it happens
Trigger: An Xml-inline class instance (from pkl-xml's `XmlInline` machinery) is visited in an unsupported position, e.g. as an attribute value or top-level in a mode that doesn't accept inline nodes.
Common situations: Mixing pkl-xml inline/element abstractions with the generic XML renderer output path; nesting inline nodes where only elements or text are allowed.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- elementNotSupportedHere
- Maps containing non-String keys cannot be rendered as JSON.
- Values of type `TypeAlias` cannot be rendered as Properties.
- Values of type `Regex` cannot be rendered as Properties. Val
- The top-level value of a YAML stream must have type `Collect
AI-assisted analysis of apple/pkl@f3efcbfc9b (2026-09-08).
Data as JSON: /api/errors/19579fd44cc7f0db.
Report an issue: GitHub.