windmill-labs/windmill · error
Unknown type `{s}`
Error message
Unknown type `{s}` What it means
The Java parser maps type_identifier nodes (wrapper/reference types) to Windmill internal types via an allowlist (String, Integer, Long, Float, Double, Boolean, Character, Object). Any other type name hits the catch-all `Ok(s) => bail!("Unknown type \`{s}\`")`, meaning the script's signature uses a Java type the parser cannot translate to a Windmill Typ.
Source
Thrown at backend/parsers/windmill-parser-java/src/lib.rs:111
}
fn find_typ<'a>(typ_node: Node<'a>, code: &str) -> anyhow::Result<(Typ, Option<Value>)> {
let null = Some(serde_json::Value::Null);
let res = match typ_node.kind() {
#[rustfmt::skip]
"type_identifier" => {
match typ_node.utf8_text(code.as_bytes()) {
Ok("String") => (Typ::Str(None), null),
Ok("Byte") => (Typ::Bytes, null),
Ok("Short") => (Typ::Int, null),
Ok("Integer") => (Typ::Int, null),
Ok("Long") => (Typ::Int, null),
Ok("Float") => (Typ::Float, null),
Ok("Double") => (Typ::Float, null),
Ok("Boolean") => (Typ::Bool, null),
Ok("Character") => (Typ::Str(None), null),
Ok("Object") => (Typ::Object(ObjectType::new(None, Some(vec![]))),null), // TODO: Complete the object type
Ok(s) => bail!("Unknown type `{s}`"),
Err(e) => bail!("Error getting type name: {}", e),
}
}
#[rustfmt::skip]
"integral_type" => {
match typ_node.utf8_text(code.as_bytes()) {
Ok("byte") => (Typ::Bytes, None),
Ok("short") => (Typ::Int, None),
Ok("int") => (Typ::Int, None),
Ok("long") => (Typ::Int, None),
Ok("char") => (Typ::Str(None), None),
Ok(s) => bail!("Unknown type `{s}`"),
Err(e) => bail!("Error getting type name: {}", e),
}
}
"floating_point_type" => {
match typ_node.utf8_text(code.as_bytes()) {
Ok("float") => (Typ::Float, None),View on GitHub (pinned to e474e8803c)
Solutions
- Change the script's parameter/return types to allowlisted ones: use String, Integer/Long, Float/Double, Boolean, Character, or Object.
- Type collections as `Object` (the parser maps Object to a generic ObjectType) and document the shape.
- If you own the parser, extend the match arms in backend/parsers/windmill-parser-java/src/lib.rs to map more type names (search ADD_NEW_LANG-style lists) or fall back to Typ::Object instead of bailing.
- Read the exact `{s}` in the error to identify which offending type name to replace.
Example fix
// before (Java script signature)
public static List<String> main(String input) { ... }
// after
public static Object main(String input) { ... } // List returned as Object Defensive patterns
Strategy: validation
Validate before calling
# validate Java script signatures before pushing
ALLOWED = {"String","Integer","Long","Float","Double","Boolean","Character","Object"}
import re
for t in re.findall(r"(?:public|private|protected)[^({]*\(([^)]*)\)", java_src):
for p in t.split(","):
typ = p.strip().split()[-2] if len(p.split()) >= 2 else None
if typ and typ not in ALLOWED:
raise ValueError(f"parameter type {typ} not supported by the Java parser; use Object") Type guard
function isParserSupportedJavaType(t: string): boolean {
return ["String","Integer","Long","Float","Double","Boolean","Character","Object"].includes(t);
} Try / catch
// when calling the parser programmatically
match parse_java_typ(...) {
Err(e) if e.to_string().starts_with("Unknown type") => {
// fall back to Typ::Object or surface a friendly UI message
}
other => other?,
} Prevention
- Restrict Java script signatures to the allowlisted types; use Object for collections and custom classes.
- Validate signatures in CI before windmill sync push.
- Read the offending type name from the error message and map it to the closest supported type.
When it happens
Trigger: Parsing a Java script whose parameters or return type reference a class type not in the allowlist — e.g. custom classes, BigDecimal, List<String>, Map<...>, or a fully-qualified type — passed to find_typ on a `type_identifier` node.
Common situations: Hub or user Java scripts typed with collection interfaces (List, ArrayList), boxed numerics beyond the allowlist (BigInteger, Short), or user-defined POJOs; windmill sync / script validation against the workspace.
Related errors
- Failed to parse code
- Failed to find inner type of array type
- Internal error: Failed to get child by field name 'type'
- Aborted from C
- vsnprintf is not supported
AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03).
Data as JSON: /api/errors/686c45cb5a7f6d4f.
Report an issue: GitHub.