# Dart: Invalid argument(s): Illegal argument in isolate message: object is unsendable - Library:'dart:async' Class: _Future@4048458

**Code:** `Illegal argument in isolate message: object is unsendable` · **Category:** Flutter / Dart · **Seen on:** Flutter

You tried to send an object (closure, Future, socket, platform object) to another isolate that cannot be copied.

## Meaning

`compute()`, `Isolate.run` and `SendPort.send` copy data. Only primitives, lists, maps, and simple data classes are allowed; closures capturing `BuildContext`/`this`, Futures, streams and native handles are not. Pass plain data and recreate objects inside the isolate.

## Common causes

- Closure capturing a non-sendable object (BuildContext, State)
- Passing a Future/Stream/Socket
- Sending a class with a native handle
- compute() with a callback that is not top-level
- Sending an object containing a ReceivePort

## Quick fix

1. Use a top-level or static function with plain arguments
2. Extract the needed fields into a simple map or data class
3. Don't capture `this`/context in the closure

## Detailed fix by platform

### Dart

1. `final result = await compute(parseJson, body);` where `List<Item> parseJson(String s) => …` is top-level

## How to diagnose

1. **Argument** — Contains closure/context/Future?
2. **Function** — Top-level?
3. **Data** — Plain types?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/flutter/isolate-unsendable-object)
