**TL;DR:** Symptom: the graph throws InvalidUpdateError naming a non-dict value. Confirm which node returned it, fix every code path to return a dict of state keys, verify with an invoke. Add a print or breakpoint at each node's return, or bisect by commenting nodes out, until you find the one returning a list, a string, or None. Cause Nodes must return a dict containing keys from the state schema.

## The error

```text
that returns a bare value, an exception handler that returns the exception object, or a node that was written to return the value instead of the update dict.

## Fix
```

## The fix

# Symptom

```
InvalidUpdateError: Expected dict, got ['whoops']
For troubleshooting, visit: docsgchain.com/oss/python/langgraph/errors/INVALID_GRAPH_NODE_RETURN_VALUE
```

## Confirm

The error names the value, not the node. Add a print or breakpoint at each node's return, or bisect by commenting nodes out, until you find the one returning a list, a string, or None.

## Cause

Nodes must return a dict containing keys from the state schema. The usual offenders: an early `return` that returns a bare value, an exception handler that returns the exception object, or a node that was written to return the value instead of the update dict.

## Fix

```python
def my_node(state: State):
    result = compute(state)
    return {"some_key": result}  # dict, always
```

Audit every return in the node, including the implicit `return None` at the end of a function that sometimes falls through.

## Verify

`graph.invoke` with a minimal input. Then run the full input that failed. The error is deterministic; if it is gone on the minimal input it is gone.

## When to use this

- You are seeing this exact error message; match the block above, not just part of it.
- The failing call matches the scenario in the title: Diagnose.
- You want the fastest verified fix before digging through logs.

## When not to use this

- Your error text differs from the block above; close cousins often have different causes.
- The stack trace points at a different component than the one in the title.
- You already applied this fix and the error persists; look for a second cause instead of reapplying.

## Compatibility

- Not pinned to a specific version; follows current Diagnose behavior.