Repository navigation
Closed
Labels
assigned for triageissue is assigned to a domain expert for further triageissue is assigned to a domain expert for further triagec: renderingUI glitches reported at the engine/skia or impeller rendering levelUI glitches reported at the engine/skia or impeller rendering levele: web_canvaskitCanvasKit (a.k.a. Skia-on-WebGL) rendering backend for WebCanvasKit (a.k.a. Skia-on-WebGL) rendering backend for Webhas reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyWeb applications specificallyteam-webOwned by Web platform teamOwned by Web platform team
Description
Steps to reproduce
- Run a Flutter Web application using the CanvasKit renderer (
flutter run -d chrome --web-renderer canvaskit). - Create a
CustomScrollViewcontaining aSliverGridwithSliverChildBuilderDelegate. - Set
addRepaintBoundaries: falseon the delegate and manually wrap each item widget with aRepaintBoundary. - Trigger scrolling or loading states in the grid.
- Check the browser developer console.
Expected results
CanvasKit should render the grid smoothly without WebGL memory/texture exceptions, or handle unrendered picture frames gracefully without throwing INVALID_VALUE: texImage2D: no image.
Actual results
The browser console continuously throws a WebGL exception and fails to render texture layers:
WebGL: INVALID_VALUE: texImage2D: no image
makeTexture @ canvaskit.js:22
methodCaller<() => unsigned int> @ canvaskit.js:150
p @ canvaskit.js:150
$func8394 @ canvaskit.wasm:0x40e954
Canvas._drawPicture @ canvaskit.js:109
a.Canvas.drawPicture @ canvaskit.js:51
drawPicture @ canvas.dart:246
(anonymous) @ surface.dart:307
### Code sample
---
### **5. Code sample **
import 'dart:async';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
void main() => runApp(const ReproApp());
class ReproApp extends StatelessWidget {
const ReproApp({super.key});
@override
Widget build(BuildContext context) =>
const MaterialApp(home: ReproGridPage());
}
class ReproGridPage extends StatefulWidget {
const ReproGridPage({super.key});
@override
State<ReproGridPage> createState() => _ReproGridPageState();
}
class _ReproGridPageState extends State<ReproGridPage> {
final ScrollController _scrollController = ScrollController();
Timer? _scrollTimer;
Timer? _stateTimer;
bool _scrollingDown = true;
int _tick = 0;
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
_scrollTimer = Timer.periodic(const Duration(milliseconds: 900), (_) {
if (!_scrollController.hasClients) return;
final max = _scrollController.position.maxScrollExtent;
_scrollController.animateTo(
_scrollingDown ? max : 0.0,
duration: const Duration(milliseconds: 800),
curve: Curves.easeInOut,
);
_scrollingDown = !_scrollingDown;
});
_stateTimer = Timer.periodic(const Duration(milliseconds: 1500), (_) {
setState(() => _tick++);
});
});
}
@override
void dispose() {
_scrollTimer?.cancel();
_stateTimer?.cancel();
_scrollController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Repro — tick: $_tick')),
body: CustomScrollView(
controller: _scrollController,
slivers: [
SliverPadding(
padding: const EdgeInsets.all(4),
sliver: SliverGrid(
gridDelegate:
const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
crossAxisSpacing: 4,
mainAxisSpacing: 4,
childAspectRatio: 1,
),
delegate: SliverChildBuilderDelegate(
addRepaintBoundaries: false, // manual wrap below
(context, index) => RepaintBoundary(
key: ValueKey('item_$index'),
child: _ReproTile(index: index, tick: _tick),
),
childCount: 60,
),
),
),
],
),
);
}
}
class _ReproTile extends StatelessWidget {
final int index;
final int tick;
const _ReproTile({required this.index, required this.tick});
@override
Widget build(BuildContext context) {
return Container(
color: Colors.grey[300],
child: CachedNetworkImage(
imageUrl: 'https://picsum.photos/seed/$index/400/400',
fit: BoxFit.cover,
placeholder: (_, __) => const Center(
child: CircularProgressIndicator(strokeWidth: 2),
),
errorWidget: (_, __, ___) =>
const Center(child: Icon(Icons.broken_image)),
),
);
}
}
### Screenshots or Video
<details open>
<summary>Screenshots / Video demonstration</summary>
[Upload media here]
</details>
### Logs
WebGL: INVALID_VALUE: texImage2D: no image
makeTexture @ canvaskit.js:22
methodCaller<() => unsigned int> @ canvaskit.js:150
p @ canvaskit.js:150
$func8394 @ canvaskit.wasm:0x40e954
$func10248 @ canvaskit.wasm:0x487f6b
Canvas._drawPicture @ canvaskit.js:109
a.Canvas.drawPicture @ canvaskit.js:51
drawPicture @ canvas.dart:246
### Flutter Doctor output
flutter doctor -v
[√] Flutter (Channel stable, 3.47.2, on Microsoft Windows [Version 10.0.26200.9168], locale en-US) [265ms]
• Flutter version 3.47.2 on channel stable at C:\src\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision d3b14c8769 (11 days ago), 2026-08-26 16:07:51 -0700
• Engine revision a804b26164
• Dart version 3.13.2
• DevTools version 2.60.0
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android,
enable-ios, cli-animations, enable-native-assets, enable-record-use, enable-swift-package-manager,
omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration
[√] Windows Version (11 Pro 64-bit, 25H2, 2009) [958ms]
[√] Android toolchain - develop for Android devices (Android SDK version 36.0.0) [5.6s]
• Android SDK at C:\Users\User\AppData\Local\Android\sdk
• Emulator version 37.1.11.0 (build_id 15917651) (CL:N/A)
• Platform android-37.0, build-tools 36.0.0
! Multiple adb binaries found. This can cause conflicts and device detection issues:
- C:\Users\User\AppData\Local\Android\Sdk\platform-tools\adb.exe
- C:\Windows\System32\adb
• Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment (build 25.0.2+-15348964-b329.117)
• All Android licenses accepted.
[√] Chrome - develop for the web [22ms]
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[X] Visual Studio - develop Windows apps [21ms]
X Visual Studio not installed; this is necessary to develop Windows apps.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[√] Connected device (3 available) [190ms]
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.26200.9168]
• Chrome (web) • chrome • web-javascript • Google Chrome 135.0.7049.84
• Edge (web) • edge • web-javascript • Microsoft Edge 152.0.4191.62
[√] Network resources [2.0s]
• All expected network resources are available.
! Doctor found issues in 1 category.
Reacted by Fernando Messias dos Santos, Matteo Ricupero, mk-code-bot and Will Calderbank
Metadata
Metadata
Assignees
Labels
assigned for triageissue is assigned to a domain expert for further triageissue is assigned to a domain expert for further triagec: renderingUI glitches reported at the engine/skia or impeller rendering levelUI glitches reported at the engine/skia or impeller rendering levele: web_canvaskitCanvasKit (a.k.a. Skia-on-WebGL) rendering backend for WebCanvasKit (a.k.a. Skia-on-WebGL) rendering backend for Webhas reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyWeb applications specificallyteam-webOwned by Web platform teamOwned by Web platform team
Activity
suryaKommana2662 commentedon Sep 7, 2026
@aliesdd1993-sketch Reproduced locally on macOS using the sample provided in the issue with
flutter run -d chrome. The Chrome DevTools console shows12WebGL: INVALID_VALUE: texImage2D: no image. The--web-renderer canvaskitoption from the reported reproduction is not available in the Flutter version I tested. Routing this toteam-webfor further investigation.Flutter Doctor -v
harryterkelsen commentedon Sep 9, 2026
This seems like a duplicate of #191800.
I'll investigate this shortly
[web] Keep ImageSource alive until Picture disposal (flutter#192516)
eduardohr-muniz commentedon Sep 24, 2026
Requesting a cherry-pick of #192516 (
PictureImageTracker) intoflutter-3.47-candidate.0.We hit this in production on 3.47.1, not in a synthetic repro: two customer-facing Flutter web apps (a store front and a merchant console) started rendering network images as solid black rectangles, intermittently, with
WebGL: INVALID_VALUE: texImage2D: no imagefrommakeTextureunderCanvas._drawPicture— the same stack as this issue. It appeared on our first production build on the 3.47 line; the previous build on 3.44.5 was clean.The reason I think this is worth a cherry-pick rather than waiting for the next minor is that the two obvious escape routes are blocked:
Staying on 3.47.x has no real workaround. The trigger is
ImageCacheeviction disposing the image mid-rasterization, so raisingimageCache.maximumSize/maximumSizeBytesonly makes eviction rarer — any catalog larger than the new ceiling brings the black frames back. That is what we shipped, and it is a delay, not a fix.Downgrading reintroduces a worse regression. The first stable containing fix(web): Fix LateInitializationError in CkSurface and SkwasmSurface #185116 ("[web] Fix LateInitializationError in
CkSurfaceandSkwasmSurface") is 3.47.0. On 3.44.x, losing the WebGL context makesonContextLostthrow, recovery aborts, and the entire canvas stays black until a page reload — considerably worse than a few black images. So web apps that need fix(web): Fix LateInitializationError in CkSurface and SkwasmSurface #185116 are pinned to exactly the versions that carry this bug.I also checked 3.47.5 (released after #192516 landed on master): its cherry-picks are the iOS 27 debug crash, the Widget Previewer scroll restoration crash, and the DDS startup
FormatException— this fix is not among them, and I could not find any open PR targetingflutter-3.47-candidate.0that carries it.Happy to test a candidate build against our production workload if that helps.
github-actions commentedon Oct 8, 2026
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 -vand a minimal reproduction of the issue.