windmill-labs/windmill · error

Nesting is not supported

Error message

Nesting is not supported

What it means

The Nu parser (windmill-parser-nu) converts Nu object-literal arguments into JSON so the script can receive typed inputs. When parsing the remainder of an object literal it encounters '{' or '[', meaning the argument contains a nested object or array, which this simplified parser cannot handle. It aborts with 'Nesting is not supported' rather than silently producing malformed JSON.

Source

Thrown at backend/parsers/windmill-parser-nu/src/lib.rs:240

                .skip(i + 1)
                .map_while(|el| {
                    let el = el.trim();

                    if closed {
                        None
                    } else {
                        if el.chars().last() == Some(close) {
                            closed = true;
                        }
                        *skip += 1;
                        Some(el)
                    }
                })
                .collect::<Vec<&str>>()
                .join(",");

            if remainder.contains(&['{', '[']) {
                bail!("Nesting is not supported")
            }

            Ok((c_2 + remainder)
                // Remove trailing comma if there is any
                .replace(&format!(",{close}"), &close.to_string()))
        }
        // It is list
        if c.contains("[") {
            if c.chars().last() != Some(']') {
                c = parse_object_literal(('[', ']'), c.clone(), ctx, i, skip)?;
            }
        }
        // It is record
        if c.contains("{") {
            if c.chars().last() != Some('}') {
                c = parse_object_literal(('{', '}'), c.clone(), ctx, i, skip)?;
            }
        }

View on GitHub (pinned to e474e8803c)

Solutions

  1. Flatten the object literal: keep only scalar values at the top level (strings, numbers, bools)
  2. Move complex/nested defaults into the script body itself and keep the signature default simple
  3. Use a JSON string default and parse it inside the Nu script
  4. Switch the parameter to a different language or use Windmill's Python/TypeScript signature support for nested defaults

Example fix

// before (Nu signature)
let x = { a: { b: 1 } }
// after
let x = { a_b: 1 }  # or: let x = '{"a": {"b": 1}}' | from json
Defensive patterns

Strategy: validation

Validate before calling

// before passing a Nu object literal default:
let flat = (value | to json) # or inspect the literal
if ($value | to json | str contains '{' or ($value | to json | str contains '[')) {
  error make { msg: "nested values not supported in Nu signature defaults" }
}

Prevention

When it happens

Trigger: Calling `parse_object_literal` (via `parse_default`) on a Nu script whose default/signature argument contains a nested object or array literal, e.g. `{ a: { b: 1 } }` or `{ a: [1, 2] }`.

Common situations: Authors writing Nu scripts with rich default values like nested configs or lists of objects in the parameter signature; the parser only supports flat object literals.

Related errors


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