Repository: flutter
Issue: Flutter web throws errors when using Chrome broswer on Android/iOS phones
Labels: c: crash,engine,platform-web,e: web_canvaskit,has reproducible steps,P2,browser: safari-ios,browser: chrome-android,team-web,triaged-web,found in release: 3.19,found in release: 3.21

### Steps to reproduce

1. Build Flutter with either `flutter build web` or `flutter build web --web-renderer canvaskit`
2. Push to Github and deploy github pages.
3. Load app on desktop. Works well.
4. Load app on mobile Chrome browser. 
5. Loads first page, but hangs when trying to load a Flame game.

### Expected results

Should be able to play game on both Desktop and Mobile.

### Actual results

Flutter app hangs when trying to load a Flame game.

### Code sample

<details open><summary>Code sample</summary>

I am loading a GameWidget from the Flame package. I suspect the tilemap or sprite image rendering has a problem on mobile browsers. 

```dart
class GameWidgetWrapper extends StatelessWidget {
  final bool loadFromSave;

  const GameWidgetWrapper({super.key, required this.loadFromSave});

  @override
  Widget build(BuildContext context) {
    return Center(
      child: ClipRect(
        child: SizedBox(
          width: gameWidth,
          height: gameHeight,
          child: GameWidget(
            game: GomilandGame(
              gameStateBloc: context.read<GameStateBloc>(),
              playerStateBloc: context.read<PlayerStateBloc>(),
              progressStateBloc: context.read<ProgressStateBloc>(),
              dayStateBloc: context.read<DayStateBloc>(),
              loadFromSave: loadFromSave,
            ),
            overlayBuilderMap: {
              'Loading': (BuildContext context, GomilandGame game) {
                return const LoadingOverlay();
              },
              'ConfirmExitRoom': (BuildContext context, GomilandGame game) {
                return ConfirmExitRoom(game: game);
              },
              'GameMenu': (BuildContext context, GomilandGame game) {
                return GameMenu(game: game);
              },
              'ConfirmExitGame': (BuildContext context, GomilandGame game) {
                return ConfirmExitGame(game: game);
              },
              'MuteButton': (BuildContext context, GomilandGame game) {
                return const MuteButton();
              },
            },
          ),
        ),
      ),
    );
  }
}
```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

![error](https://github.com/flutter/flutter/assets/62128387/9484d534-24b9-47a9-817c-e312f9435744)

</details>


### Logs

<details open><summary>Logs</summary>

```console
Uncaught TypeError: Cannot read properties of null (reading 'readPixels')
    at Pg.E1 (main.dart.js:34438:5)
    at E_.IF (main.dart.js:53394:5)
    at main.dart.js:94147:16
    at aGG.a (main.dart.js:4468:62)
    at aGG.$2 (main.dart.js:41098:14)
    at Object.o (main.dart.js:4454:10)
    at RM.afa (main.dart.js:94157:10)
    at RM.uV (main.dart.js:94138:19)
    at main.dart.js:94031:14
    at aGG.a (main.dart.js:4468:62)
```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[√] Flutter (Channel stable, 3.16.5, on Microsoft Windows [Version 10.0.19045.4046], locale en-GB)
    • Flutter version 3.16.5 on channel stable at C:\Users\limch\Documents\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 78666c8dc5 (2 months ago), 2023-12-19 16:14:14 -0800
    • Engine revision 3f3e560236
    • Dart version 3.2.3
    • DevTools version 2.28.4

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at C:\Users\limch\AppData\Local\Android\Sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Build Tools 2019 16.11.8)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools
    • Visual Studio Build Tools 2019 version 16.11.32002.261
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2021.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)

[√] IntelliJ IDEA Ultimate Edition (version 2023.2)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2023.2
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart

[√] VS Code (version 1.86.2)
    • VS Code at C:\Users\limch\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.82.0

[√] Connected device (4 available)
    • M2010J19SG (mobile) • 8bbb5f8a0421 • android-arm64  • Android 12 (API 31)
    • Windows (desktop)   • windows      • windows-x64    • Microsoft Windows [Version 10.0.19045.4046]
    • Chrome (web)        • chrome       • web-javascript • Google Chrome 122.0.6261.70
    • Edge (web)          • edge         • web-javascript • Microsoft Edge 122.0.2365.52

[√] Network resources
    • All expected network resources are available.

• No issues found!
```

</details>