Repository navigation
Assertion error "Trying to render a disposed EngineFlutterView" (on flutter web, master channel) #141253
Copy link
Copy link
Closed
Labels
r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
Description
Steps to reproduce
- Start a WEB application
- Press "Hot restart" button (testing on Android Studio)
Expected results
App restarts successfully
Actual results
App doesn't restart and throws assertion error as shown in the logs below.
Code sample
On every code base
Screenshots or Video
No response
Logs
Logs
======== Exception caught by scheduler library =====================================================
The following assertion was thrown during a scheduler callback:
Assertion failed: org-dartlang-sdk:///lib/_engine/engine/window.dart:91:12
!isDisposed
"Trying to render a disposed EngineFlutterView."
When the exception was thrown, this was the stack:
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 297:3 throw_
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 38:3 assertFailed
lib/_engine/engine/window.dart 91:13 render
packages/flutter/src/rendering/view.dart 309:7 compositeFrame
packages/flutter/src/rendering/binding.dart 582:19 drawFrame
packages/flutter/src/widgets/binding.dart 991:13 drawFrame
packages/flutter/src/rendering/binding.dart 443:5 [_handlePersistentFrameCallback]
packages/flutter/src/scheduler/binding.dart 1386:7 [_invokeFrameCallback]
packages/flutter/src/scheduler/binding.dart 1311:9 handleDrawFrame
packages/flutter/src/scheduler/binding.dart 1169:5 [_handleDrawFrame]
lib/_engine/engine/platform_dispatcher.dart 1346:5 invoke
lib/_engine/engine/platform_dispatcher.dart 260:5 invokeOnDrawFrame
lib/_engine/engine/initialization.dart 185:36 <fn>
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 550:37 _checkAndCall
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 555:39 dcall
====================================================================================================
Flutter Doctor output
Doctor output
[✓] Flutter (Channel master, 3.19.0-3.0.pre.25, on macOS 14.2.1 23C71 darwin-arm64, locale it-IT)
• Flutter version 3.19.0-3.0.pre.25 on channel master at /Users/leonardo/Documents/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision a103002496 (3 hours ago), 2024-01-10 02:02:12 -0500
• Engine revision 7e6f3d847e
• Dart version 3.4.0 (build 3.4.0-11.0.dev)
• DevTools version 2.31.0
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
• Android SDK at /Users/leonardo/Library/Android/sdk
• Platform android-34, build-tools 33.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15C500b
• CocoaPods version 1.14.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2022.3)
• Android Studio at /Applications/Android Studio.app/Contents
• 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 17.0.6+0-17.0.6b829.9-10027231)
[✓] VS Code (version 1.85.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.80.0
[✓] Connected device (3 available)
• iPhone di Leonardo (mobile) • 00008120-000638C03AF3C01E • ios • iOS 17.3 21D5026f
• macOS (desktop) • macos • darwin-arm64 • macOS 14.2.1 23C71 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 120.0.6099.216
[✓] Network resources
• All expected network resources are available.
• No issues found!Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
Activity
darshankawar commentedon Jan 10, 2024
@LeoRc01 Thanks for the report. I am unable to replicate it after running a sample code on web from AS using latest master channel and then hot restarting it which works as expected. No errors were received.
Are there any specific steps or pattern that leads to the error. Does the error occur in canvaskit mode only or in html rendering as well ?
LeoRc01 commentedon Jan 10, 2024
@danagbemava-nc @darshankawar thank you for your time and answers.
Testing on CLI and VSCode doesn't throw any error but the application won't change, as shown in the video below.
Testing on AS it throws the error as mentioned in the issue.
Android Studio video
65868d05-a19a-4d14-9ae1-182123003a94.mp4
VSCode video
a5a5a01e-9fee-41fb-8006-9f9ca9415ee3.mp4
darshankawar commentedon Jan 11, 2024
Thanks for the update. I think this is similar to #140684, so please follow-up in it for further updates. Closing this as a duplicate.
github-actions commentedon Jan 25, 2024
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.pedromassango commentedon Mar 8, 2024
Still happening
gjlmotea commentedon Mar 10, 2024
Encountered the same problem, it only occurs on the web.
Works fine on mobile platform.
(
flutter doctor -vstatus is ok)4 remaining items
pedromassango commentedon Mar 12, 2024
I'm on stable channel.
huycozy commentedon Mar 14, 2024
This should be fixed on the latest beta or master channels, you can try switching to these channels and re-check it.
r-durao-pvotal commentedon Mar 20, 2024
Tried running the sample counter app on the master channel. This issue specifically seems to not be happening anymore, but I'm seeing another error being logged this time around:
mbecroft commentedon Mar 20, 2024
Exactly the same errors here when running in Chrome in debug mode after switching to master channel.
IGNORE THE BELOW, my hot reload issue was simply a stupid error on my part with time synchronisation. I did see the same JS errors when on master though.
As of the last week or so, I have not been able to hot reload or restart - making development work almost impossible.
I also tested with Linux native, and while I get no error messages, hot reload and hot restart do not work.
To be clear, hot reload and hot restart do have an effect (especially with hot restart, you can see the screen be redrawn). The issue is that code changes have no effect.
Given this problem arose since a flutter update from a couple of weeks ago, I am thinking of downgrading to see if that fixes it.
huycozy commentedon Mar 21, 2024
@r-durao-pvotal I also can reproduce that issue on master channel. Filed it here in dart repo: dart-lang/sdk#55256
r-durao-pvotal commentedon Mar 21, 2024
@huycozy do you have an estimate on when this issue will be tackled? This severely hinders web app development using flutter. Having to re-run the app every time we want to test a change is extremely time consuming
huycozy commentedon Mar 21, 2024
@r-durao-pvotal I'm not sure, but usually issues like this will be noticed quickly (within a day)
nialljawad96 commentedon Mar 22, 2024
This is a shambles. Disabling issues on both master and stable channels
pedromassango commentedon Mar 22, 2024
Closing as this isn't happening on master.
github-actions commentedon Apr 11, 2024
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.