Illegal argument in isolate message: object is unsendable Flutter / Dart Origin: On your device OSI layer 7 · Application Last updated 4 Nov 2026

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.

Exact message you may see 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')
Seen on: Flutter

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?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: On your device. Errors that are often confused with or caused by this one (click to open):

Bad state: No element — Dart: Bad state: No element — .first, .last or .single on an empty list (Flutter / Dart)Bad state: No elementBad state: Stream has already been listened to — Dart: Bad state: Stream has already been listened to (Flutter / Dart)Bad state: Stream has…Error: Couldn't resolve the package — Dart: Error: Couldn't resolve the package 'x' in 'package:x/x.dart' (Flutter / Dart)Error: Couldn't resol…FormatException: Unexpected character — Dart: FormatException: Unexpected character (at character 1) <!DOCTYPE html> — jsonDecode of an HTML page (Flutter / Dart)FormatException: Unex…Looking up a deactivated widget's ancestor is unsafe — Flutter: Looking up a deactivated widget's ancestor is unsafe. At this point the state of the widget's element tree is no longer stable (Flutter / Dart)Looking up a deactiva…The argument type can't be assigned to the parameter type — Dart: The argument type 'String?' can't be assigned to the parameter type 'String' (Flutter / Dart)The argument type can…The getter/method isn't defined for the type — Dart: The getter 'name' isn't defined for the type 'User' / The method 'foo' isn't defined for the class (Flutter / Dart)The getter/method isn…type '_InternalLinkedHashMap' is not a subtype of type 'List<dynamic>' — Dart: type '_InternalLinkedHashMap<String, dynamic>' is not a subtype of type 'List<dynamic>' in type cast (Flutter / Dart)type '_InternalLinked…Illegal a…

Explore the map of this error Full error map →

🧠 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.