windmill-labs/windmill · error

parameter syntax unsupported: `{}`: {:#?}

Error message

parameter syntax unsupported: `{}`: {:#?}

What it means

While converting a main-function parameter into a MainArgSignature, parse_param supports pattern shapes that yield a name and type (plain identifiers, destructuring handled by anon naming, etc.). A parameter pattern in the `left` position that matches none of the supported shapes (e.g. an object property binding or computed pattern) is rejected with the source snippet and AST debug dump.

Source

Thrown at backend/parsers/windmill-parser-ts/src/lib.rs:572

        Pat::Assign(AssignPat { left, right, .. }) => {
            let (name, mut typ, _nullable, otyp) = match *left {
                Pat::Ident(ident) => {
                    let otyp = ident
                        .type_ann
                        .as_ref()
                        .and_then(|ta| detect_union_array_otyp(&ta.type_ann));
                    let (name, typ, nullable) =
                        binding_ident_to_arg(symbol_table, type_resolver, &ident);
                    (name, typ, nullable, otyp)
                }
                Pat::Object(ObjectPat { type_ann, .. }) => {
                    let (typ, nullable) = eval_type_ann(symbol_table, type_resolver, &type_ann);
                    *counter += 1;
                    let name = format!("anon{}", counter);
                    (name, typ, nullable, None)
                }
                _ => {
                    return Err(anyhow::anyhow!(
                        "parameter syntax unsupported: `{}`: {:#?}",
                        cm.span_to_snippet(left.span())
                            .unwrap_or_else(|_| cm.span_to_string(left.span())),
                        *left
                    ))
                }
            };

            let dflt = if skip_dflt {
                None
            } else {
                match *right {
                    Expr::Lit(Lit::Str(Str { value, .. })) => {
                        Some(Value::String(value.to_string()))
                    }
                    Expr::Lit(Lit::Num(Number { value, .. }))
                        if (value == (value as u64) as f64) =>
                    {

View on GitHub (pinned to e474e8803c)

Solutions

  1. Simplify the parameter to a plain typed identifier (e.g. `args: MyArgs`) and destructure inside the function body
  2. Read the snippet and AST dump in the message to see the exact unsupported pattern
  3. Extract nested bindings into a separate type and access fields inside the function

Example fix

// before
export function main({ a: { b } }: Input) { return b; }
// after
export function main(input: Input) { const b = input.a.b; return b; }
Defensive patterns

Strategy: fallback

Validate before calling

// reject exotic parameter patterns before submitting
const unsupported = /\(\s*\{|\[\s*\w+\s*,/.exec(mainSig);
if (unsupported) throw new Error('Use a plain typed identifier for main args');

Type guard

function hasPlainIdentifierParams(sig) { return /^\(?\s*\w+\s*:?/.test(sig.trim()); }

Try / catch

try {
  buildSignature(code);
} catch (e) {
  if (String(e).includes('parameter syntax unsupported')) {
    // fallback: ask user to use a single typed args object
  } else throw e;
}

Prevention

When it happens

Trigger: A main-argument declared with a pattern parse_param does not handle — e.g. `function main({a: {b}}: any)` or other nested/renamed object binding shapes — while generating the arg signature.

Common situations: Highly destructured or renamed-parameter signatures in scripts; code generated by AI/tools that emits exotic parameter patterns the signature parser never anticipated.

Related errors


AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03). Data as JSON: /api/errors/ba9f93f2e87b69ca. Report an issue: GitHub.