-
Notifications
You must be signed in to change notification settings - Fork 27.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[web] Flutter web hot restart not reflecting changes #141588
Comments
Hello @Anas35. We will need more information to enable us reproduce this on our end. Details
|
Hey @dam-ease! I ran into this on |
Thanks for your response @Anas35. flutter doctor -v
|
Good i thought i am the only one experiencing this |
The |
bisecting flutter/flutter leads to 8316e85, which almost certainly points to flutter/engine#49239 |
I verified this by using engine binaries from flutter/engine#49239, and it is broken. |
Here is the rev-list of commits in that dart -> engine roll: dart-lang/sdk@b214430...e8cdc55 |
@nshahan can you take a look? Your ddc changes seem like obvious suspects. |
I'm seeing the following error in the JS console when hot restarting:
It looks like this is coming from the call to |
@elliette yep, you're right! I changed that assertion to a noop in the render method (that was my first suspicion), but the bug still seems to persist :S |
@ditman - after changing the assertion, are there additional exceptions caught? or is it happening silently? |
I can reproduce this with a local engine built with the Dart SDK commit that enables newRuntimeTypes by default (https://dart.googlesource.com/sdk/+/83ba9fe0a8d59d3ad80b1e44d62d5dff026d0122). The issue does not reproduce with the previous Dart SDK commit. With newRuntimeTypes, hot restart works as expected if I patch the default Flutter app If it creates a |
@sigmundch thanks to @elliette I found a small issue that was causing a re-render right before the app would hot-restart (we just need to unsubscribe a listener before hot restart), but the issue seems to be unrelated. Failures are silent, everything seems to succeed (se the latest message from @jason-simmons!) |
As an update here, it sounds like @nshahan has root caused this, and is working on verifying a fix locally. |
We're still working on verifying the Dart SDK fix is correct and will pass Flutter framework CI. We expect this to land and roll to flutter/flutter some time this week. |
https://dart-review.googlesource.com/c/sdk/+/347220 landed in the Dart SDK, will update here when it rolls to flutter/flutter. |
The fix has rolled through to the flutter/flutter repo and anyone running on the bleeding edge should be fixed now. I'm working on the cherry pick process to get the fix into the beta release. |
This PR adds a test that reproduces the problem described in the linked issue: hot restart on the web seems to not update if the app being run is `const`. The new test is expected to fail, until the `const` issue with hot restart in the web is resolved. Expected failure mode is a 15s timeout in the following test: ``` 02:31 +3 ~1 -1: Hot reload (index.html: Default) (with `const MyApp()`)): newly added code executes during hot restart [E] TimeoutException after 0:00:15.000000: Future not completed dart:async _startMicrotaskLoop ... ``` (And then a bunch of output that I'm not 100% sure is intended :)) ## Issues * #141588
Gonna mark this as fixed (on master) now that #141824 has landed. Please follow dart-lang/sdk#54723 for progress on this fix reaching beta. |
Clear local caches storing const values in each module. Issue: flutter/flutter#141588 Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/347220 Cherry-pick-request: TBA Change-Id: Id298076e8671eddb1f2dabb09fcfb38a532d85d6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348204 Reviewed-by: Sigmund Cherem <sigmund@google.com> Commit-Queue: Nicholas Shahan <nshahan@google.com>
…s. (#49958) While debugging a different [issue](flutter/flutter#141588), @elliette identified a problem with the web engine when a flutter web app hot-restarts. TL;DR: the engine is requesting the framework to re-render a view as it tears them down, causing an assertion failure. This fix stops listening to changes on view "disposed" events when the engine itself is being disposed, so it doesn't trigger re-renders for views that are never coming back. ## Issues * Fixes flutter/flutter#142030 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
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 |
Steps to reproduce
flutter create test
flutter run
Expected results
The text should be changed.
Actual results
No changes.
Code sample
Default Template
Logs
flutter run -v
Flutter Doctor output
Doctor output
The text was updated successfully, but these errors were encountered: