windmill-labs/windmill · error
Unexpected Java type node kind: {} for '{}'. This type is no
Error message
Unexpected Java type node kind: {} for '{}'. This type is not handled by Windmill, please open an issue if this seems to be an error What it means
windmill-parser-java's find_typ maps tree-sitter Java type nodes (primitive types, generic_type, array_type, etc.) to Windmill Typs. Any type node kind outside the handled match arms falls through to this bail. It means the script declares a parameter whose Java type expression the parser has no mapping for, so the signature cannot be inferred.
Source
Thrown at backend/parsers/windmill-parser-java/src/lib.rs:148
Ok("double") => (Typ::Float, None),
Ok(s) => bail!("Unknown type `{s}`"),
Err(e) => bail!("Error getting type name: {}", e),
}
}
"boolean_type" => {
match typ_node.utf8_text(code.as_bytes()) {
Ok("boolean") => (Typ::Bool, None),
Ok(s) => bail!("Unknown type `{s}`"),
Err(e) => bail!("Error getting type name: {}", e),
}
}
"array_type" => {
let new_typ_node = typ_node
.named_child(0)
.ok_or(anyhow!("Failed to find inner type of array type"))?;
(Typ::List(Box::new(find_typ(new_typ_node, code)?.0)), null)
}
wc => bail!(
"Unexpected Java type node kind: {} for '{}'. This type is not handled by Windmill, please open an issue if this seems to be an error",
wc,
typ_node.utf8_text(code.as_bytes())?
),
};
Ok(res)
}
fn parse_java_typ<'a>(
param_node: Node<'a>,
code: &str,
) -> anyhow::Result<(Option<String>, Typ, String, Option<Value>)> {
let name = param_node
.child_by_field_name("name")
.and_then(|n| n.utf8_text(code.as_bytes()).ok())
.unwrap_or("");
let otyp_node = param_node.child_by_field_name("type");View on GitHub (pinned to e474e8803c)
Solutions
- Replace the unsupported type with a supported one: primitive types, String, boxed primitives, simple generics like List<T>/T[], plain arrays.
- Use `Object` as a fallback parameter type if the value shape is opaque to Windmill.
- Simplify nested types (e.g. `List<List<String>>` or wildcard `List<?>`) to a concrete supported form.
- If a common type is rejected, open an issue as the message suggests, including the parameter declaration.
Example fix
// before
void main(Map<String, ?> params) {
// after
void main(Map<String, Object> params) { Defensive patterns
Strategy: validation
Validate before calling
const SUPPORTED = /^(String|Byte|Short|Integer|Long|Float|Double|Boolean|Character|Object|byte|short|int|long|char|float|double|boolean)$/;
function validateJavaParamType(t) {
const base = t.replace(/\[\s*\]/g, '').trim();
if (SUPPORTED.test(base)) return null;
if (/^(List|Map|Set)</.test(base) && !base.includes('?')) return null;
return `Java type '${t}' is not handled; use primitives, String, boxed types, List<T>/T[] or Object`;
} Try / catch
try {
const sig = parseJavaSignature(source);
} catch (e) {
if (String(e).includes('Unexpected Java type node kind')) {
throw new Error(`Unsupported Java parameter type: simplify it (no wildcards/var/annotations), or wrap as Object`);
}
throw e;
} Prevention
- Restrict main() parameter types to primitives, String, boxed types, simple generics and arrays
- Avoid wildcards (?), var, intersection types and annotated type expressions in entrypoint signatures
- Test signature parsing locally before deploying the script
When it happens
Trigger: Declaring a main/worker function parameter with an unsupported Java type node kind — e.g. wildcard types (`List<?>`), annotated types, intersection types, nested/qualified inner types, or other tree-sitter node kinds not in the handled list — when deploying a Java script to Windmill.
Common situations: Using generic wildcards (`Map<String, ?>`) or arrays-of-generics edge cases; using types the parser never got an arm for like `var`; copy-pasting library types with annotations (`@NotNull String[]` forms parsed differently).
Related errors
- Unknown type `{s}`
- Error getting type name: {}
- typed records are not supported, use `ident: record`
- typed tables are not supported, use `ident: table`
- {s} is not supported
AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03).
Data as JSON: /api/errors/c07211d6e1b045c6.
Report an issue: GitHub.