{"record":{"id":"ba9f93f2e87b69ca","repo":"windmill-labs/windmill","slug":"parameter-syntax-unsupported","errorCode":null,"errorMessage":"parameter syntax unsupported: `{}`: {:#?}","messagePattern":"parameter syntax unsupported: `(.+?)`: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/parsers/windmill-parser-ts/src/lib.rs","lineNumber":572,"sourceCode":"        Pat::Assign(AssignPat { left, right, .. }) => {\n            let (name, mut typ, _nullable, otyp) = match *left {\n                Pat::Ident(ident) => {\n                    let otyp = ident\n                        .type_ann\n                        .as_ref()\n                        .and_then(|ta| detect_union_array_otyp(&ta.type_ann));\n                    let (name, typ, nullable) =\n                        binding_ident_to_arg(symbol_table, type_resolver, &ident);\n                    (name, typ, nullable, otyp)\n                }\n                Pat::Object(ObjectPat { type_ann, .. }) => {\n                    let (typ, nullable) = eval_type_ann(symbol_table, type_resolver, &type_ann);\n                    *counter += 1;\n                    let name = format!(\"anon{}\", counter);\n                    (name, typ, nullable, None)\n                }\n                _ => {\n                    return Err(anyhow::anyhow!(\n                        \"parameter syntax unsupported: `{}`: {:#?}\",\n                        cm.span_to_snippet(left.span())\n                            .unwrap_or_else(|_| cm.span_to_string(left.span())),\n                        *left\n                    ))\n                }\n            };\n\n            let dflt = if skip_dflt {\n                None\n            } else {\n                match *right {\n                    Expr::Lit(Lit::Str(Str { value, .. })) => {\n                        Some(Value::String(value.to_string()))\n                    }\n                    Expr::Lit(Lit::Num(Number { value, .. }))\n                        if (value == (value as u64) as f64) =>\n                    {","sourceCodeStart":554,"sourceCodeEnd":590,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/backend/parsers/windmill-parser-ts/src/lib.rs#L554-L590","documentation":"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.","triggerScenarios":"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.","commonSituations":"Highly destructured or renamed-parameter signatures in scripts; code generated by AI/tools that emits exotic parameter patterns the signature parser never anticipated.","solutions":["Simplify the parameter to a plain typed identifier (e.g. `args: MyArgs`) and destructure inside the function body","Read the snippet and AST dump in the message to see the exact unsupported pattern","Extract nested bindings into a separate type and access fields inside the function"],"exampleFix":"// before\nexport function main({ a: { b } }: Input) { return b; }\n// after\nexport function main(input: Input) { const b = input.a.b; return b; }","handlingStrategy":"fallback","validationCode":"// reject exotic parameter patterns before submitting\nconst unsupported = /\\(\\s*\\{|\\[\\s*\\w+\\s*,/.exec(mainSig);\nif (unsupported) throw new Error('Use a plain typed identifier for main args');","typeGuard":"function hasPlainIdentifierParams(sig) { return /^\\(?\\s*\\w+\\s*:?/.test(sig.trim()); }","tryCatchPattern":"try {\n  buildSignature(code);\n} catch (e) {\n  if (String(e).includes('parameter syntax unsupported')) {\n    // fallback: ask user to use a single typed args object\n  } else throw e;\n}","preventionTips":["Use a single typed parameter (e.g. `args: Input`) and destructure inside the body","Avoid nested/renamed destructuring in main's parameter list","Prefer explicit types over complex patterns in entrypoint signatures"],"tags":["typescript","signature","parameters","unsupported-syntax"],"backgroundTag":"unsupported-parameter-syntax","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}