-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Closed
Copy link
Labels
platform-webWeb applications specificallyWeb applications specifically
Description
Hey, this is quite a serious bug that we caught while shipping a new build of Dara.
Very hard to debug too, since it only manifests in the release mode for web, which doesn't have a sane way to get a stack trace (getsentry/sentry-dart#417)
Code sample
// lib/main.dart
void main() {
List<int> items = [1, 2, 3];
print(items[3]);
}Steps to Reproduce
Expected results:
- Execute
flutter run -d chromeon the code sample - See the following error -
Error: RangeError (index): Index out of range: index should be less than 3: 3
at Object.throw_ [as throw] (http://localhost:51727/dart_sdk.js:5067:11)
at Array.[dartx._get] (http://localhost:51727/dart_sdk.js:17485:21)
at main$ (http://localhost:51727/packages/dara/main.dart.lib.js:18:28)
at main (http://localhost:51727/web_entrypoint.dart.lib.js:36:29)
at main.next (<anonymous>)
at http://localhost:51727/dart_sdk.js:40571:33
at _RootZone.runUnary (http://localhost:51727/dart_sdk.js:40441:59)
at _FutureListener.thenAwait.handleValue (http://localhost:51727/dart_sdk.js:35363:29)
at handleValueCallback (http://localhost:51727/dart_sdk.js:35931:49)
at Function._propagateToListeners (http://localhost:51727/dart_sdk.js:35969:17)
at _Future.new.[_completeWithValue] (http://localhost:51727/dart_sdk.js:35817:23)
at http://localhost:51727/dart_sdk.js:34998:46
at _RootZone.runUnary (http://localhost:51727/dart_sdk.js:40441:59)
at _FutureListener.then.handleValue (http://localhost:51727/dart_sdk.js:35363:29)
at handleValueCallback (http://localhost:51727/dart_sdk.js:35931:49)
at Function._propagateToListeners (http://localhost:51727/dart_sdk.js:35969:17)
at _Future.new.[_completeWithValue] (http://localhost:51727/dart_sdk.js:35817:23)
at async._AsyncCallbackEntry.new.callback (http://localhost:51727/dart_sdk.js:35838:35)
at Object._microtaskLoop (http://localhost:51727/dart_sdk.js:40708:13)
at _startMicrotaskLoop (http://localhost:51727/dart_sdk.js:40714:13)
at http://localhost:51727/dart_sdk.js:36191:9
Actual results:
- Run
flutter run -d chrome --release - Range error is not thrown. Instead, the console spits out a null.
Flutter doctor
[✓] Flutter (Channel stable, 2.10.4, on macOS 12.3 21E230 darwin-arm, locale en-IN)
• Flutter version 2.10.4 at /Users/dev/Tools/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision c860cba910 (13 days ago), 2022-03-25 00:23:12 -0500
• Engine revision 57d3bac3dd
• Dart version 2.16.2
• DevTools version 2.9.2
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0-rc3)
• Android SDK at /Users/dev/Library/Android/sdk
• Platform android-31, build-tools 31.0.0-rc3
• Java binary at: /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_275-b01)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.3
[✓] 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/docs/get-started/install/macos#android-setup for detailed instructions).
[☠] IntelliJ IDEA Ultimate Edition (the doctor check crashed)
✗ Due to an error, the doctor check did not complete. If the error message below is not helpful, please let us know about this issue at https://github.com/flutter/flutter/issues.
✗ FormatException: Unexpected extension byte (at offset 5)
• #0 _Utf8Decoder.convertSingle (dart:convert-patch/convert_patch.dart:1789:7)
#1 Utf8Decoder.convert (dart:convert/utf.dart:351:42)
#2 InputStream.readString (package:archive/src/util/input_stream.dart:207:30)
#3 new ZipDirectory.read (package:archive/src/zip/zip_directory.dart:40:30)
#4 ZipDecoder.decodeBuffer (package:archive/src/zip_decoder.dart:19:30)
#5 ZipDecoder.decodeBytes (package:archive/src/zip_decoder.dart:14:12)
#6 IntelliJPlugins._findPluginXml (package:flutter_tools/src/intellij/intellij.dart:130:44)
#7 IntelliJPlugins._readPackageVersion (package:flutter_tools/src/intellij/intellij.dart:141:40)
#8 IntelliJPlugins.validatePackage (package:flutter_tools/src/intellij/intellij.dart:63:35)
#9 IntelliJValidator.validate (package:flutter_tools/src/intellij/intellij_validator.dart:103:15)
#10 asyncGuard.<anonymous closure> (package:flutter_tools/src/base/async_guard.dart:111:32)
#11 asyncGuard.<anonymous closure> (package:flutter_tools/src/base/async_guard.dart:109:18)
#12 _rootRun (dart:async/zone.dart:1426:13)
#13 _CustomZone.run (dart:async/zone.dart:1328:19)
#14 _runZoned (dart:async/zone.dart:1861:10)
#15 runZonedGuarded (dart:async/zone.dart:1849:12)
#16 runZoned (dart:async/zone.dart:1780:12)
#17 asyncGuard (package:flutter_tools/src/base/async_guard.dart:109:3)
#18 Doctor.startValidatorTasks (package:flutter_tools/src/doctor.dart:205:9)
#19 Doctor.diagnose (package:flutter_tools/src/doctor.dart:309:47)
#20 DoctorCommand.runCommand (package:flutter_tools/src/commands/doctor.dart:50:48)
#21 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1320:12)
<asynchronous suspension>
#22 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1161:27)
<asynchronous suspension>
#23 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#24 CommandRunner.runCommand (package:args/command_runner.dart:209:13)
<asynchronous suspension>
#25 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:281:9)
<asynchronous suspension>
#26 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#27 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
<asynchronous suspension>
#28 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
<asynchronous suspension>
#29 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#30 main (package:flutter_tools/executable.dart:94:3)
<asynchronous suspension>
[✓] IntelliJ IDEA Ultimate Edition (version 2021.3.2)
• IntelliJ at /Users/dev/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/213.6777.52/IntelliJ IDEA.app
• 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.56.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.22.0
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-arm64 • macOS 12.3 21E230 darwin-arm
• Chrome (web) • chrome • web-javascript • Google Chrome 100.0.4896.75
! Error: iPad is not connected. Xcode will continue when iPad is connected. (code -13)
[✓] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 2 categories.
Metadata
Metadata
Assignees
Labels
platform-webWeb applications specificallyWeb applications specifically