Dart: Invalid argument(s): Illegal argument in isolate message: object is unsendable - Library:'dart:async' Class: _Future@4048458
You tried to send an object (closure, Future, socket, platform object) to another isolate that cannot be copied.
Illegal argument in isolate message: object is unsendableInvalid argument(s): Illegal argument in isolate messageobject is unsendable - Library:'dart:async'Illegal argument in isolate message: (object extends NativeWrapper - Library:'dart:io') 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
- Use a top-level or static function with plain arguments
- Extract the needed fields into a simple map or data class
- Don't capture
this/context in the closure
Detailed fix by platform
Dart
final result = await compute(parseJson, body);whereList<Item> parseJson(String s) => …is top-level
How to diagnose
- Argument — Contains closure/context/Future?
- Function — Top-level?
- Data — Plain types?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in Flutter / Dart
- setState() called after dispose() Flutter: setState() called after dispose(): _MyState#1a2b3 (lifecycle state: defunct, not mounted)
- A RenderFlex overflowed Flutter: A RenderFlex overflowed by x pixels on the right/bottom
- Null check operator used on a null value Dart/Flutter: Null check operator used on a null value
Other ways to find it
Where this error sits
Origin: On your device. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 4 Nov 2026