Skip to content

CircularProgressIndicator and other animation controllers on Flutter Web throws infinite !isDisposed exceptions after hot restart (regression in Flutter 3.35 / Dart 3.9) #175260

@hbuhrmann

Description

@hbuhrmann

Steps to reproduce

After upgrading to Flutter 3.35.3 stable with Dart 3.9.2, hot restarting a web app that contains a CircularProgressIndicator causes an infinite stream of exceptions:

Assertion failed: org-dartlang-sdk:///lib/_engine/engine/window.dart:99:12
!isDisposed
"Trying to render a disposed EngineFlutterView."

This continues endlessly until the browser tab is refreshed.

This did not occur on earlier Flutter versions (≤3.32.x). It appears to be a regression in how the web engine handles active tickers across hot restart.

Steps to Reproduce:

Create a new Flutter project.

Replace main.dart with the code below.

Run in Chrome (flutter run -d chrome).

Perform a hot restart in Android Studio or from the terminal.

Observe the infinite !isDisposed spam in the console.

Does not reproduce on Android or iOS — only Flutter Web.

Other animation-driven widgets (custom AnimationController, AnimatedBuilder) can cause similar errors if active during hot restart.

This is new; it worked fine in earlier stable releases.

Expected results

Hot restart should cleanly reset the app state without leaving behind any tickers or animation frames.

Actual results

Hot restart leaves the CircularProgressIndicator’s ticker running, causing an infinite stream of !isDisposed exceptions. Same with pulseExample

Code sample

Code sample Progress Indicator
import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: Scaffold(
        body: Center(
          child: CircularProgressIndicator(), // culprit
        ),
      ),
    );
  }
}
Code sample Another animationController
import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: Scaffold(
        body: Center(
          child: PulseExample(),
        ),
      ),
    );
  }
}

class PulseExample extends StatefulWidget {
  const PulseExample({super.key});

  @override
  State<PulseExample> createState() => _PulseExampleState();
}

class _PulseExampleState extends State<PulseExample>
    with SingleTickerProviderStateMixin {
  late AnimationController _controller;
  late Animation<double> _scale;

  @override
  void initState() {
    super.initState();
    _controller =
        AnimationController(vsync: this, duration: const Duration(seconds: 1));
    _scale = Tween<double>(begin: 1.0, end: 1.5).animate(
      CurvedAnimation(parent: _controller, curve: Curves.easeInOut),
    );
    _loop();
  }

  Future<void> _loop() async {
    while (mounted) {
      await _controller.forward();
      await _controller.reverse();
    }
  }

  @override
  void dispose() {
    _controller.stop();
    _controller.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return AnimatedBuilder(
      animation: _scale,
      builder: (_, child) =>
          Transform.scale(scale: _scale.value, child: child),
      child: const Icon(Icons.favorite, size: 64, color: Colors.red),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

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:99: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 274:3       throw_
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 44:3        assertFailed
lib/_engine/engine/window.dart 99:13                                              render
package:flutter/src/rendering/view.dart 363:7                                     compositeFrame
package:flutter/src/rendering/binding.dart 634:19                                 drawFrame
package:flutter/src/widgets/binding.dart 1261:13                                  drawFrame
package:flutter/src/rendering/binding.dart 495:5                                  [_handlePersistentFrameCallback]
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 118:77  tear
package:flutter/src/scheduler/binding.dart 1434:7                                 [_invokeFrameCallback]
package:flutter/src/scheduler/binding.dart 1347:9                                 handleDrawFrame
package:flutter/src/scheduler/binding.dart 1200:5                                 [_handleDrawFrame]
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 118:77  tear
lib/_engine/engine/platform_dispatcher.dart 1522:5                                invoke
lib/_engine/engine/platform_dispatcher.dart 265:5                                 invokeOnDrawFrame
lib/_engine/engine/frame_service.dart 192:32                                      [_renderFrame]
lib/_engine/engine/frame_service.dart 99:9                                        <fn>
dart-sdk/lib/async/zone.dart 1849:54                                              runUnary
dart-sdk/lib/async/zone.dart 1804:26                                              <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/js_allow_interop_patch.dart 224:27    _callDartFunctionFast1
====================================================================================================

======== Exception caught by scheduler library =====================================================
The following assertion was thrown during a scheduler callback:
Assertion failed: org-dartlang-sdk:///lib/_engine/engine/window.dart:99: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 274:3       throw_
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 44:3        assertFailed
lib/_engine/engine/window.dart 99:13                                              render
package:flutter/src/rendering/view.dart 363:7                                     compositeFrame
package:flutter/src/rendering/binding.dart 634:19                                 drawFrame
package:flutter/src/widgets/binding.dart 1261:13                                  drawFrame
package:flutter/src/rendering/binding.dart 495:5                                  [_handlePersistentFrameCallback]
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 118:77  tear
package:flutter/src/scheduler/binding.dart 1434:7                                 [_invokeFrameCallback]
package:flutter/src/scheduler/binding.dart 1347:9                                 handleDrawFrame
package:flutter/src/scheduler/binding.dart 1200:5                                 [_handleDrawFrame]
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 118:77  tear
lib/_engine/engine/platform_dispatcher.dart 1522:5                                invoke
lib/_engine/engine/platform_dispatcher.dart 265:5                                 invokeOnDrawFrame
lib/_engine/engine/frame_service.dart 192:32                                      [_renderFrame]
lib/_engine/engine/frame_service.dart 99:9                                        <fn>
dart-sdk/lib/async/zone.dart 1849:54                                              runUnary
dart-sdk/lib/async/zone.dart 1804:26                                              <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/js_allow_interop_patch.dart 224:27    _callDartFunctionFast1
====================================================================================================

======== Exception caught by scheduler library =====================================================
The following assertion was thrown during a scheduler callback:
Assertion failed: org-dartlang-sdk:///lib/_engine/engine/window.dart:99: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 274:3       throw_
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 44:3        assertFailed
lib/_engine/engine/window.dart 99:13                                              render
package:flutter/src/rendering/view.dart 363:7                                     compositeFrame
package:flutter/src/rendering/binding.dart 634:19                                 drawFrame
package:flutter/src/widgets/binding.dart 1261:13                                  drawFrame
package:flutter/src/rendering/binding.dart 495:5                                  [_handlePersistentFrameCallback]
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 118:77  tear
package:flutter/src/scheduler/binding.dart 1434:7                                 [_invokeFrameCallback]
package:flutter/src/scheduler/binding.dart 1347:9                                 handleDrawFrame
package:flutter/src/scheduler/binding.dart 1200:5                                 [_handleDrawFrame]
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 118:77  tear
lib/_engine/engine/platform_dispatcher.dart 1522:5                                invoke
lib/_engine/engine/platform_dispatcher.dart 265:5                                 invokeOnDrawFrame
lib/_engine/engine/frame_service.dart 192:32                                      [_renderFrame]
lib/_engine/engine/frame_service.dart 99:9                                        <fn>
dart-sdk/lib/async/zone.dart 1849:54                                              runUnary
dart-sdk/lib/async/zone.dart 1804:26                                              <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/js_allow_interop_patch.dart 224:27    _callDartFunctionFast1
====================================================================================================

======== Exception caught by scheduler library =====================================================
The following assertion was thrown during a scheduler callback:
Assertion failed: org-dartlang-sdk:///lib/_engine/engine/window.dart:99: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 274:3       throw_
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 44:3        assertFailed
lib/_engine/engine/window.dart 99:13                                              render
package:flutter/src/rendering/view.dart 363:7                                     compositeFrame
package:flutter/src/rendering/binding.dart 634:19                                 drawFrame
package:flutter/src/widgets/binding.dart 1261:13                                  drawFrame
package:flutter/src/rendering/binding.dart 495:5                                  [_handlePersistentFrameCallback]
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 118:77  tear
package:flutter/src/scheduler/binding.dart 1434:7                                 [_invokeFrameCallback]
package:flutter/src/scheduler/binding.dart 1347:9                                 handleDrawFrame
package:flutter/src/scheduler/binding.dart 1200:5                                 [_handleDrawFrame]
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 118:77  tear
lib/_engine/engine/platform_dispatcher.dart 1522:5                                invoke
lib/_engine/engine/platform_dispatcher.dart 265:5                                 invokeOnDrawFrame
lib/_engine/engine/frame_service.dart 192:32                                      [_renderFrame]
lib/_engine/engine/frame_service.dart 99:9                                        <fn>
dart-sdk/lib/async/zone.dart 1849:54                                              runUnary
dart-sdk/lib/async/zone.dart 1804:26                                              <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/js_allow_interop_patch.dart 224:27    _callDartFunctionFast1
====================================================================================================

======== Exception caught by scheduler library =====================================================
The following assertion was thrown during a scheduler callback:
Assertion failed: org-dartlang-sdk:///lib/_engine/engine/window.dart:99: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 274:3       throw_
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 44:3        assertFailed
lib/_engine/engine/window.dart 99:13                                              render
package:flutter/src/rendering/view.dart 363:7                                     compositeFrame
package:flutter/src/rendering/binding.dart 634:19                                 drawFrame
package:flutter/src/widgets/binding.dart 1261:13                                  drawFrame
package:flutter/src/rendering/binding.dart 495:5                                  [_handlePersistentFrameCallback]
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 118:77  tear
package:flutter/src/scheduler/binding.dart 1434:7                                 [_invokeFrameCallback]
package:flutter/src/scheduler/binding.dart 1347:9                                 handleDrawFrame
package:flutter/src/scheduler/binding.dart 1200:5                                 [_handleDrawFrame]
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 118:77  tear
lib/_engine/engine/platform_dispatcher.dart 1522:5                                invoke
lib/_engine/engine/platform_dispatcher.dart 265:5                                 invokeOnDrawFrame
lib/_engine/engine/frame_service.dart 192:32                                      [_renderFrame]
lib/_engine/engine/frame_service.dart 99:9                                        <fn>
dart-sdk/lib/async/zone.dart 1849:54                                              runUnary
dart-sdk/lib/async/zone.dart 1804:26                                              <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/js_allow_interop_patch.dart 224:27    _callDartFunctionFast1
====================================================================================================

======== Exception caught by scheduler library =====================================================
The following assertion was thrown during a scheduler callback:
Assertion failed: org-dartlang-sdk:///lib/_engine/engine/window.dart:99: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 274:3       throw_
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 44:3        assertFailed
lib/_engine/engine/window.dart 99:13                                              render
package:flutter/src/rendering/view.dart 363:7                                     compositeFrame
package:flutter/src/rendering/binding.dart 634:19                                 drawFrame
package:flutter/src/widgets/binding.dart 1261:13                                  drawFrame
package:flutter/src/rendering/binding.dart 495:5                                  [_handlePersistentFrameCallback]
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 118:77  tear
package:flutter/src/scheduler/binding.dart 1434:7                                 [_invokeFrameCallback]
package:flutter/src/scheduler/binding.dart 1347:9                                 handleDrawFrame
package:flutter/src/scheduler/binding.dart 1200:5                                 [_handleDrawFrame]
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 118:77  tear
lib/_engine/engine/platform_dispatcher.dart 1522:5                                invoke
lib/_engine/engine/platform_dispatcher.dart 265:5                                 invokeOnDrawFrame
lib/_engine/engine/frame_service.dart 192:32                                      [_renderFrame]
lib/_engine/engine/frame_service.dart 99:9                                        <fn>
dart-sdk/lib/async/zone.dart 1849:54                                              runUnary
dart-sdk/lib/async/zone.dart 1804:26                                              <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/js_allow_interop_patch.dart 224:27    _callDartFunctionFast1
====================================================================================================
Application finished.

Flutter Doctor output

Doctor output
Flutter 3.35.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision a402d9a437 (8 days ago) • 2025-09-03 14:54:31 -0700
Engine • hash 672c59cfa87c8070c20ba2cd1a6c2a1baf5cf08b (revision ddf47dd3ff) (8 days ago) • 2025-09-03 20:02:13.000Z
Tools • Dart 3.9.2 • DevTools 2.48.0
PS C:\Users\hanne\AndroidStudioProjects\hot_restart_with_material_app_router> flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.35.3, on Microsoft Windows [Version 10.0.26100.6584], locale en-GB)
[√] Windows Version (11 Home 64-bit, 24H2, 2009)
[√] Android toolchain - develop for Android devices (Android SDK version 36.0.0)
[√] Chrome - develop for the web
[X] Visual Studio - develop Windows apps
    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
[√] Android Studio (version 2024.2)
[√] VS Code (version 1.99.3)
[√] Connected device (3 available)
    ! Device Z5P7WG7TJJTCR4PZ is offline.
[√] Network resources

! Doctor found issues in 1 category.

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: animationAnimation APIsc: crashStack traces logged to the consolec: regressionIt was better in the past than it is nowfound in release: 3.35Found to occur in 3.35found in release: 3.37Found to occur in 3.37has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyr: fixedIssue is closed as already fixed in a newer versiont: hot reloadReloading code during "flutter run"team-webOwned by Web platform team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions