Skip to content
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

Loading notification does not disappear after app launches in release mode (or profile mode for web) #3338

Closed
DanTup opened this issue May 13, 2021 · 14 comments
Labels
in debugger Relates to the debug adapter or process of launching a debug session in flutter Relates to running Flutter apps is bug
Milestone

Comments

@DanTup
Copy link
Member

DanTup commented May 13, 2021

Running in profile mode for web seems to get stuck with this notification. Split from #3206

@DanTup DanTup added is bug in flutter Relates to running Flutter apps in debugger Relates to the debug adapter or process of launching a debug session labels May 13, 2021
@DanTup DanTup added this to the v3.23.0 milestone May 13, 2021
@DanTup
Copy link
Member Author

DanTup commented May 13, 2021

It looks like this may be because we never get an app.debugPort messages from Flutter when launching profile mode on the web.

@DanTup
Copy link
Member Author

DanTup commented 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 no app.debugPort event from Flutter (flutter run -d ios --machine --profile will send one, but flutter run -d chrome --machine --profile will not).

@grouma
Copy link
Member

grouma commented May 13, 2021

I'm not familiar with the profile flag. Does that imply DDC? Note that package:dwds only works with DDC.

@DanTup
Copy link
Member Author

DanTup commented 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.

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.

@jacob314
Copy link

Profile mode is Dart2JS. Profile mode is expected to match the characteristics of the release build app.

@grouma
Copy link
Member

grouma commented 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
Copy link

@grouma

but it isn't a current priority

Do you mean this issue or the debugging tools for Dart2JS in general?

@grouma
Copy link
Member

grouma commented May 13, 2021

Debugging tools for Dart2JS.

@DanTup DanTup 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) May 17, 2021
@DanTup
Copy link
Member Author

DanTup commented 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 DanTup closed this as completed in d84a6b6 May 17, 2021
@DanTup
Copy link
Member Author

DanTup commented May 17, 2021

@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
Copy link

amr-eniou-3r commented May 17, 2021

@DanTup By this fix, Do I will be able to connect profile mode to Dev tools for Flutter web?

@DanTup
Copy link
Member Author

DanTup commented 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
Copy link

amr-eniou-3r commented 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
Copy link
Member

grouma commented 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?

I'm not sure if we have a canonical one. @nshahan may know?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in debugger Relates to the debug adapter or process of launching a debug session in flutter Relates to running Flutter apps is bug
Projects
None yet
Development

No branches or pull requests

5 participants