Repository navigation
Creating an empty Vertices object causes an exception on web (canvaskit) #160355
Copy link
Copy link
Closed
Closed
Copy link
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listc: crashStack traces logged to the consoleStack traces logged to the consolec: regressionIt was better in the past than it is nowIt was better in the past than it is nowc: 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 Webengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.platform-webWeb applications specificallyWeb applications specificallyteam-webOwned by Web platform teamOwned by Web platform teamtriaged-webTriaged by Web platform teamTriaged by Web platform team
Description
Description
If you attempt to create a Vertices object which doesn't have any vertices in it, the following exception is thrown, which didn't use to be the case. This is currently blocking the Flutter roll, see cl/705912913 for details.
DartError: TypeError: null: type 'Null' is not a subtype of type 'JavaScriptObject'
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 307:3 throw_
errors.dart:307
dart-sdk/lib/_internal/js_dev_runtime/private/profile.dart 117:39 _failedAsCheck
profile.dart:117
dart-sdk/lib/_internal/js_shared/lib/rti.dart 1554:3 _generalAsCheckImplementation
rti.dart:1554
dart-sdk/lib/_internal/js_shared/lib/js_util_patch.dart 110:3 callMethod$
js_util_patch.dart:110
lib/_engine/engine/canvaskit/canvaskit_api.dart 95:8 CanvasKitExtension.MakeVertices
canvaskit_api.dart:95
lib/_engine/engine/canvaskit/vertices.dart 82:45 __
vertices.dart:82
lib/_engine/engine/canvaskit/vertices.dart 66:23 raw
vertices.dart:66
lib/_engine/engine/canvaskit/renderer.dart 124:18 createVerticesRaw
renderer.dart:124
lib/ui/canvas.dart 45:28 raw
canvas.dart:45
packages/manual_tests/simple_test.dart 7:41 main
simple_test.dart:7
web_entrypoint.dart 24:31 <fn>
web_entrypoint.dart:24
lib/ui_web/ui_web/initialization.dart 41:15 <fn>
initialization.dart:41
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 622:19 <fn>
async_patch.dart:622
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 647:23 <fn>
async_patch.dart:647
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 593:31 <fn>
async_patch.dart:593
dart-sdk/lib/async/zone.dart 1849:54 runUnary
zone.dart:1849
dart-sdk/lib/async/future_impl.dart 208:18 handleValue
future_impl.dart:208
dart-sdk/lib/async/future_impl.dart 932:44 handleValueCallback
future_impl.dart:932
dart-sdk/lib/async/future_impl.dart 961:13 _propagateToListeners
future_impl.dart:961
dart-sdk/lib/async/future_impl.dart 712:5 [_completeWithValue]
future_impl.dart:712
dart-sdk/lib/async/future_impl.dart 792:7 callback
future_impl.dart:792
dart-sdk/lib/async/schedule_microtask.dart 40:11 _microtaskLoop
schedule_microtask.dart:40
dart-sdk/lib/async/schedule_microtask.dart 49:5 _startMicrotaskLoop
schedule_microtask.dart:49
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 186:7 <fn>
async_patch.dart:186
Here's a simple reproduction case:
import 'dart:typed_data';
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
void main() {
final ui.Vertices verts = ui.Vertices.raw(
VertexMode.triangles,
Float32List(0),
indices: Uint16List(0),
textureCoordinates: Float32List(0),
);
print('$verts');
runApp(const SizedBox.shrink());
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listc: crashStack traces logged to the consoleStack traces logged to the consolec: regressionIt was better in the past than it is nowIt was better in the past than it is nowc: 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 Webengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.platform-webWeb applications specificallyWeb applications specificallyteam-webOwned by Web platform teamOwned by Web platform teamtriaged-webTriaged by Web platform teamTriaged by Web platform team
Activity
[-]Creating an empty `Vertices` object causes an exception on web[/-][+]Creating an empty `Vertices` object causes an exception on web (canvaskit)[/+]gspencergoog commentedon Dec 16, 2024
No longer blocking the roll, because cl/705912913 was submitted.
[web] Gracefully handle empty ui.Vertices (#162461)
github-actions commentedon Feb 14, 2025
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.filiph commentedon May 14, 2025
I see this was fixed a while ago but I'm seeing the same or very similar error when calling the following constructor on the web:
The error:
Flutter version:
Should I create a new issue then?
harryterkelsen commentedon Jun 4, 2025
@filiph Please open another issue if you are still hitting this error, thanks!