Skip to content

WASM build does not render large image: "GL_INVALID_VALUE: The specified dimensions are outside of the bounds of the texture." #159088

@brian-superlist

Description

@brian-superlist

Steps to reproduce

  1. Create a new app
  2. Add an Image.network or Image.asset (I've provided one in the sample project that fails to render)
  3. Build release app with WASM support: flutter build web --release --wasm
  4. Serve the built app with dhttpd (or any server): dart pub global run dhttpd --path build/web --port 8080
  5. Open Chrome
  6. Open Dev Tools > Console
  7. Navigate to http://localhost:8080
  8. Exception is thrown

Expected results

The image is rendered and I can see it

Actual results

No image is rendered, and the following error is displayed in the dev tools console:

[.WebGL-0x130005b6200] GL_INVALID_VALUE: The specified dimensions are outside of the bounds of the texture.

The image is displayed if I run the app in JS mode or as a Mac app.

Code sample

Code sample

Bare bones Flutter project with a picture of a lovely oyster I ate, but sadly does not render in a WASM flutter app.

image_test.zip

Screenshots or Video

Screenshots / Video demonstration Screenshot 2024-11-18 at 5 18 17 PM

Logs

Logs
~/lab/image_test ❯ dart pub global run dhttpd --path build/web --port 8080
Server started on port 8080
2024-11-18T17:12:33.187951  0:00:00.012078 GET     [200] /
2024-11-18T17:12:33.217684  0:00:00.000466 GET     [200] /flutter_bootstrap.js
2024-11-18T17:12:34.529936  0:00:00.001509 GET     [200] /favicon.png
2024-11-18T17:12:34.534872  0:00:00.000427 GET     [200] /flutter_service_worker.js?v=3785530705
2024-11-18T17:12:34.543993  0:00:00.000772 GET     [200] /main.dart.js
2024-11-18T17:12:34.545418  0:00:00.000267 GET     [200] /main.dart.wasm
2024-11-18T17:12:34.546311  0:00:00.000224 GET     [200] /main.dart.mjs
2024-11-18T17:12:34.549607  0:00:00.000480 GET     [200] /index.html
2024-11-18T17:12:34.553332  0:00:00.000371 GET     [200] /flutter_bootstrap.js
2024-11-18T17:12:34.556098  0:00:00.000521 GET     [200] /assets/AssetManifest.bin.json
2024-11-18T17:12:34.557166  0:00:00.000285 GET     [200] /assets/FontManifest.json
2024-11-18T17:12:34.948157  0:00:00.000854 GET     [200] /assets/fonts/MaterialIcons-Regular.otf
2024-11-18T17:12:34.950250  0:00:00.000932 GET     [200] /assets/packages/cupertino_icons/assets/CupertinoIcons.ttf
2024-11-18T17:12:34.981901  0:00:00.000288 GET     [200] /manifest.json
2024-11-18T17:12:34.995853  0:00:00.002702 GET     [404] /flutter.js.map
2024-11-18T17:12:35.165185  0:00:00.000393 GET     [200] /assets/assets/test.jpg

Flutter Doctor output

Doctor output
[!] Flutter (Channel [user-branch], 3.27.0-1.0.pre.535, on macOS 15.1 24B83 darwin-arm64, locale en-US)
    ! Flutter version 3.27.0-1.0.pre.535 on channel [user-branch] at /Users/brian/superlist/superlist/.flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/setup.
    ! Warning: `flutter` on your path resolves to /Users/brian/lab/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/brian/superlist/superlist/.flutter. Consider adding /Users/brian/superlist/superlist/.flutter/bin to the front of your path.
    ! Warning: `dart` on your path resolves to /Users/brian/lab/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/brian/superlist/superlist/.flutter. Consider adding /Users/brian/superlist/superlist/.flutter/bin to the front of your path.
    ! Upstream repository https://github.com/superlistapp/flutter.git is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to https://github.com/superlistapp/flutter.git to dismiss this error.
    • Framework revision 012f6b34c6 (30 hours ago), 2024-11-17 06:34:08 -0500
    • Engine revision 4c1eb8cacb
    • Dart version 3.7.0 (build 3.7.0-157.0.dev)
    • DevTools version 2.41.0-dev.2
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at /Users/brian/Library/Android/sdk
    • Platform android-35, build-tools 35.0.0
    • ANDROID_HOME = /Users/brian/Library/Android/sdk
    • Java binary at: /usr/bin/java
    • Java version OpenJDK Runtime Environment Zulu17.50+19-CA (build 17.0.11+9-LTS)
    • All Android licenses accepted.

[!] Xcode - develop for iOS and macOS (Xcode 16.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16B40
    ! CocoaPods 1.16.1 out of date (1.16.2 is recommended).
        CocoaPods is a package manager for iOS or macOS platform code.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/to/platform-plugins
      To update CocoaPods, see https://guides.cocoapods.org/using/getting-started.html#updating-cocoapods

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/to/macos-android-setup for detailed instructions).

[✓] IntelliJ IDEA Ultimate Edition (version 2024.3)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 82.2.4
    • Dart plugin version 243.21565.120

[✓] VS Code (version 1.95.3)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.100.0

[✓] Connected device (4 available)
    • Briphone (mobile)               • 00008120-000A20980233401E • ios            • iOS 18.0.1 22A3370
    • macOS (desktop)                 • macos                     • darwin-arm64   • macOS 15.1 24B83 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad     • darwin         • macOS 15.1 24B83 darwin-arm64
    • Chrome (web)                    • chrome                    • web-javascript • Google Chrome 131.0.6778.70
    ! Error: Browsing on the local area network for Brian’s iPad. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 3 categories.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions