You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Loading notification does not disappear after app launches in release mode (or profile mode for web) #3338
@grouma@jacob314 should there be an available VM Service for a web app running with --profile? For non-web it seems there is, but for web there's no app.debugPort event from Flutter (flutter run -d ios --machine --profile will send one, but flutter run -d chrome --machine --profile will not).
My understanding for non-web is that Profile mode is "almost a release mode" but still has some code to enable running profiling tools etc.
package:dwds only works with DDC.
Ah, that's probably the issue here then. https://flutter.dev/docs/testing/build-modes says that a web app in profile mode is compiled with dart2js. In that case, Dart-Code should probably be aware that it's not going to get a VM Service URI for a web app in debug mode, and behave accordingly.
changed the title [-]Flutter web app stuck "Compiling lib\main.dart for the Web..." when running in profile mode[/-][+]Loading notification does not disappear after app launches in release mode (or profile mode for web)[/+]on May 17, 2021
This seems to affect Release mode for all platforms too - because we use the VM service as a signal for the app having finished loading, anything without a VM service will leave the loading toast visible.
@grouma@jonahwilliams I've fixed this by not expecting to get a VM Service (app.debugPort from flutter run --machine) for all release mode runs, or for profile mode on the web. However it meant Dart-Code now has to know whether:
Web profile mode will have a VM Service
Which devices are web devices
This doesn't seem ideal (although it may be slightly simpler if/when the debug adapter moves into flutter_tools), but I'm not sure there's an easy alternative. We may need to update this if either of those things change in future.
@amr-eniou-3r not when running on web - my understanding from @grouma's comments above it that profile-mode on Web does not support the VM Service and therefore is not currently usable with DevTools. Profile mode for non-web should work though.
This fix just prevents the loading notification from hanging around after the app launches (since it was previously waiting for a debugger connection that would never happen).
Activity
DanTup commentedon May 13, 2021
It looks like this may be because we never get an
app.debugPortmessages from Flutter when launching profile mode on the web.DanTup commentedon May 13, 2021
@grouma @jacob314 should there be an available VM Service for a web app running with
--profile? For non-web it seems there is, but for web there's noapp.debugPortevent from Flutter (flutter run -d ios --machine --profilewill send one, butflutter run -d chrome --machine --profilewill not).grouma commentedon May 13, 2021
I'm not familiar with the profile flag. Does that imply
DDC? Note thatpackage:dwdsonly works with DDC.DanTup commentedon May 13, 2021
My understanding for non-web is that Profile mode is "almost a release mode" but still has some code to enable running profiling tools etc.
Ah, that's probably the issue here then. https://flutter.dev/docs/testing/build-modes says that a web app in profile mode is compiled with dart2js. In that case, Dart-Code should probably be aware that it's not going to get a VM Service URI for a web app in debug mode, and behave accordingly.
jacob314 commentedon May 13, 2021
Profile mode is Dart2JS. Profile mode is expected to match the characteristics of the release build app.
grouma commentedon May 13, 2021
Yeah that sounds like the issue. Long term we want to support better debugging tools for Dart2JS but it isn't a current priority.
amorenew commentedon May 13, 2021
@grouma
Do you mean this issue or the debugging tools for Dart2JS in general?
grouma commentedon May 13, 2021
Debugging tools for Dart2JS.
[-]Flutter web app stuck "Compiling lib\main.dart for the Web..." when running in profile mode[/-][+]Loading notification does not disappear after app launches in release mode (or profile mode for web)[/+]DanTup commentedon May 17, 2021
This seems to affect Release mode for all platforms too - because we use the VM service as a signal for the app having finished loading, anything without a VM service will leave the loading toast visible.
DanTup commentedon May 17, 2021
@grouma @jonahwilliams I've fixed this by not expecting to get a VM Service (
app.debugPortfromflutter run --machine) for all release mode runs, or for profile mode on the web. However it meant Dart-Code now has to know whether:This doesn't seem ideal (although it may be slightly simpler if/when the debug adapter moves into flutter_tools), but I'm not sure there's an easy alternative. We may need to update this if either of those things change in future.
amr-eniou-3r commentedon May 17, 2021
@DanTup By this fix, Do I will be able to connect profile mode to Dev tools for Flutter web?
DanTup commentedon May 17, 2021
@amr-eniou-3r not when running on web - my understanding from @grouma's comments above it that profile-mode on Web does not support the VM Service and therefore is not currently usable with DevTools. Profile mode for non-web should work though.
This fix just prevents the loading notification from hanging around after the app launches (since it was previously waiting for a debugger connection that would never happen).
amr-eniou-3r commentedon May 17, 2021
@grouma @DanTup I wonder if you could give me the link for the issue of profile mode for Flutter web which I should subscribe to?
grouma commentedon May 17, 2021
I'm not sure if we have a canonical one. @nshahan may know?