Skip to content

createImageFromTextureSource throws on wasm with transferred ownership #183166

Closed

Description

@curt-weber

Steps to reproduce

  1. create project with code sample below and add web to pubspec: web: ^1.1.1
  2. run with flutter run -d chrome --wasm

Expected results

Decode with and without ownership transfer

Actual results

error: Bad state: DataCloneError: Failed to execute 'postMessage' on 'Worker': Value at index 0 does not have a transferable type.

Had to switch to master to get details, stable just showed JavaScriptError

Code sample

Code sample
import 'dart:js_interop';
import 'dart:ui_web';
import 'package:flutter/widgets.dart';
import 'package:web/web.dart';

Future<void> main() async {
  runApp(const SizedBox.expand());
  final element = HTMLImageElement()
    ..crossOrigin = 'anonymous'
    ..src = 'https://picsum.photos/200/300';
  await element.decode().toDart;
  final image = await createImageFromTextureSource(
    element,
    height: element.height,
    transferOwnership: true, // TODO throws on wasm
    width: element.width,
  );
  print('${image.width}x${image.height}');
}

Screenshots or Video

Logs

No response

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, 3.42.0-1.0.pre-361, on Microsoft Windows [Version 10.0.26200.7840], locale en-US)
[√] Windows Version (Windows 11 or higher, 25H2, 2009)
[√] Android toolchain - develop for Android devices (Android SDK version 36.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.13.6)
[√] Connected device (3 available)
[√] Network resources

• No issues found!

Activity

  1. added
    in triagePresently being triaged by the triage team
    engineflutter/engine related. See also e: labels.
    platform-webWeb applications specifically
    e: wasmIssues related to the wasm build of Flutter Web.
    team-webOwned by Web platform team
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    on Mar 5, 2026
  2. mbcorona commented on Mar 5, 2026

    @mbcorona
    Member

    Thanks for reporting @curt-weber .

    I was able to reproduce the DataCloneError on both master and stable channels when running on Chrome with the --wasm flag.

    Routing to team-web to evaluate the transferOwnership behavior with HTMLImageElement in WASM.

  3. removed
    in triagePresently being triaged by the triage team
    on Mar 5, 2026
  4. added
    triaged-webTriaged by Web platform team
    P1High-priority issues at the top of the work list
    on Mar 11, 2026
  5. github-actions commented on Apr 1, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  6. locked as resolved and limited conversation to collaborators on Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P1High-priority issues at the top of the work liste: wasmIssues related to the wasm build of Flutter Web.engineflutter/engine related. See also e: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyteam-webOwned by Web platform teamtriaged-webTriaged by Web platform team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions