devtools icon indicating copy to clipboard operation
devtools copied to clipboard

Flutter 3.32.0: Network tab cannot log requests made after an app Hot Restart

Open maxfrees opened this issue 7 months ago • 42 comments

Why is there a problem with the network again? The latest version does not display http requests

There will be problems every time it is released

I hope can be fixed. network is the most commonly used function of devtool and it always has problems

maxfrees avatar May 22 '25 07:05 maxfrees

Same for me. Installed it ~30 minutes ago for the first time, pulling my hairs since then trying to figure out why I can't see the Network tab.

BarakAlmog avatar May 23 '25 11:05 BarakAlmog

What version of DevTools are you using? (run flutter --version)

CC @bkonyi @srawlins

kenzieschmoll avatar May 23 '25 16:05 kenzieschmoll

last version

[!] Flutter (Channel stable, 3.32.0, on Microsoft Windows [ 10.0.19045.5854], locale zh-CN) [923ms] • Flutter version 3.32.0 on channel stable at E:\flutter\default ! Warning: flutter on your path resolves to E:\flutter\versions\stable\bin\flutter, which is not inside your current Flutter SDK checkout at E:\flutter\default. Consider adding E:\flutter\default\bin to the front of your path. ! Warning: dart on your path resolves to E:\flutter\versions\stable\bin\dart, which is not inside your current Flutter SDK checkout at E:\flutter\default. Consider adding E:\flutter\default\bin to the front of your path. • Upstream repository https://github.com/flutter/flutter.git • Framework revision be698c48a6 (2 days ago), 2025-05-19 12:59:14 -0700 • Engine revision 1881800949 • Dart version 3.8.0 • DevTools version 2.45.1 • Pub download mirror https://pub.flutter-io.cn • Flutter download mirror https://storage.flutter-io.cn • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

maxfrees avatar May 23 '25 16:05 maxfrees

Same for me. Installed it ~30 minutes ago for the first time, pulling my hairs since then trying to figure out why I can't see the Network tab.

If you cannot see the network tab, that would be a separate issue. Please file a separate issue with a screenshot. Thanks!

srawlins avatar May 23 '25 17:05 srawlins

@maxfrees @BarakAlmog If you're encountering this issue frequently, this workaround might help temporarily unblock you until a fix is available — in case you'd like to try it: https://github.com/flutter/devtools/issues/9188#issuecomment-2905466746

hrajwade96 avatar May 23 '25 18:05 hrajwade96

@maxfrees @BarakAlmog If you're encountering this issue frequently, this workaround might help temporarily unblock you until a fix is available — in case you'd like to try it: #9188 (comment)

You can only revert it to a certain version, but this won't solve the current problem.

maxfrees avatar May 25 '25 08:05 maxfrees

When will it be updated? Why does the devtools network have problems every time a version is released? Don’t you test it?

maxfrees avatar May 27 '25 05:05 maxfrees

When opening in web brower, there won't even be any activity

maxfrees avatar May 27 '25 05:05 maxfrees

@kenzieschmoll @srawlins

Please, need your support here, ASAP. The issue appears when using Hot restart and Hot reload (Widget Network Inspector on Web or on VSCode).

muhammadkamel avatar May 27 '25 11:05 muhammadkamel

So that's one of the reasons why you want devtools, material, and Cupertino to move out of flutter, the problem has not been solved, and it has to wait until flutter is released, so what should I do in the middle of the few months? Don't use it ? You'll have to wait until Flutter is released to fix it

maxfrees avatar May 27 '25 12:05 maxfrees

As a workaround, you can download Flutter SDK version 3.24.5, then navigate to: YOUR_FLUTTER_SDK/bin/cache/dart-sdk/bin/resources/ and replace the devtools folder. 😂

@maxfrees

muhammadkamel avatar May 27 '25 12:05 muhammadkamel

For folks experiencing an issue with requests showing up in the Network tab, please provide reproduction steps so that we can work on a fix. We do have test coverage for this tool (all passing), so unfortunately the regressions you are experiencing are not something that we've been able to reproduce locally or on our CI tests.

Additional information you can provide that would help us track down the problem:

  1. Thorough reproduction steps (including the code of how you are sending the http request). Please also include information about your developer workflow such as how you are starting your Flutter app, what type of app you are running (target platform like Android, iOS, etc. and run mode, debug or profile), whether you are triggering hot restarts or hot reloads at any point in your user journey of using the Network tool in DevTools, how you are opening DevTools, etc.
  2. Information about your machine (Mac, Windows, etc.)
  3. Information about your network speed (we've seen issues in the past come from hard to reproduce race conditions triggered by the latency of the user's internet connection).

Thanks! CC @srawlins @bkonyi for any additional questions or ideas. If we can get this information, we should try to get a fix out ASAP and possibly a cherry pick.

kenzieschmoll avatar May 27 '25 17:05 kenzieschmoll

I am unable to reproduce. Using Dart 3.8.0, I can start the networking test app (found in packages/devtools_app/test/test_infra/fixtures/networking_app/, attach to the process with DevTools via the "The Dart DevTools debugger and profiler is available at" link, and send requests to it's control port (e.g. "localhost:{controlPort}/get/"). When I do this, I see network requests show up in the DevTools Network tab. (e.g. "GET", "POST", "PUT.")

@muhammadkamel:

The issue appears when using Hot restart and Hot reload (Widget Network Inspector on Web or on VSCode).

Can you elaborate? Specific steps will help. What is "Widget Network Inspector"?

srawlins avatar May 27 '25 17:05 srawlins

Hi everyone, @kenzieschmoll @srawlins

Please, check the attached video:

muhammad@Muhammads-MacBook-Pro wukad_mobile_app % flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.32.0, on macOS 15.5 24F74 darwin-arm64, locale en-EG) [✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 16.3) [✓] Chrome - develop for the web [✓] Android Studio (version 2024.3) [✓] VS Code (version 1.100.2) [✓] Connected device (3 available) [✓] Network resources

• No issues found!

https://github.com/user-attachments/assets/c0cee335-44b1-488d-bf51-402d38bd0aa5

muhammadkamel avatar May 27 '25 18:05 muhammadkamel

@muhammadkamel Sorry, I cannot tell what I am looking at in the video. Can you give specific steps?

srawlins avatar May 27 '25 18:05 srawlins

@srawlins

I am uploading another video now, from replacing devtool app (Flutter SDK 3.24.5) with Flutter SDK 3.32.0 and I'll provide you all details.

muhammadkamel avatar May 27 '25 18:05 muhammadkamel

This another video with replacing old Flutter SDK devtool app (version 3.24.5) and it works fine. :) https://github.com/user-attachments/assets/4ae9e91d-fe8b-4b53-a235-6c09b4d56a91

muhammadkamel avatar May 27 '25 18:05 muhammadkamel

@srawlins

Could you please download the last video?

muhammadkamel avatar May 27 '25 18:05 muhammadkamel

@muhammadkamel That video was even less clear 😁 . But it looks to me like you're connecting DevTools to a running Flutter app. And this Flutter app seems to be making network requests, is that correct? Can you elaborate? Can you give specific steps?

srawlins avatar May 27 '25 18:05 srawlins

@srawlins

Yeah! This is right 😁 The network requests not showing in the Network screen that I open from DevTools.

When I am replacing the devtool folder of old Flutter SDK like version 3.24.5, it works fine, but I doesn't showing me requests GET, POST logs and data with the new Flutter SDK 3.32.0

Is this clear? 😁

muhammadkamel avatar May 27 '25 18:05 muhammadkamel

@srawlins

Kindly note the issue exits also when open Network from DevTools in the web.

muhammadkamel avatar May 27 '25 18:05 muhammadkamel

I maybe can reproduce this (without clear instructions, I'll never be sure). Using a flutter app that I have which can make network requests, here is what I can see:

  1. In VS Code, looking at my Flutter app, I can run the Flutter app.
  2. In VS Code, I can then open the DevTools Network page from the command palette.
  3. Then I can trigger my Flutter app to make network requests; they are seen in the DevTools Network page, as expected.
  4. @muhammadkamel mentioned Hot Restart above (and he might be clicking it in the videos), so I click the green circular arrow button to hot restart my Flutter app.
  5. After it restarts successfully, I again trigger network requests. This time however, I cannot see them in the Network page. (!!)
  6. I close and re-open the Network page, and can once again see the triggered network requests. 👍
  7. When I hot restart the app a second time, once again I cannot see the requests in the Network page.

srawlins avatar May 27 '25 18:05 srawlins

@srawlins It seems @muhammadkamel is running a Flutter App in VS code and embedded Devtools.

In the first video he’s using the latest version where in the logs he can see the network requests but in the devtools they are not showing up.

In the second video he switched to an older version of devtools (which comes with Flutter 3.24.5) where the requests are coming as expected.

hrajwade96 avatar May 27 '25 18:05 hrajwade96

@srawlins @kenzieschmoll

I think replacing the old version of DevTools worked fine for me. I hope this issue gets resolved as soon as possible.

muhammadkamel avatar May 27 '25 18:05 muhammadkamel

@srawlins my suspicion is that we are not requesting / listening for requests on the proper isolates after hot restart, since isolates are shut down and restarted in this case.

kenzieschmoll avatar May 27 '25 19:05 kenzieschmoll

replacing the old version of DevTools worked fine for me

If this is working for you to unblock your development workflow, then great. But please note that this is not guaranteed to work and may break other DevTools-related functionality in your IDE or in the browser.

Kindly note the issue exits also when open Network from DevTools in the web

If you are referring to Chrome DevTools, this is not Dart & Flutter DevTools and any issues with Chrome DevTools should be filed against that product.

kenzieschmoll avatar May 27 '25 19:05 kenzieschmoll

@kenzieschmoll @bkonyi do you know if anything changed "recently", like since 3.7.0 cut-off, regarding isolates / hot restart / DevTools? It sounds like this functionality used to work (in Flutter 3.24.5).

srawlins avatar May 27 '25 20:05 srawlins

replacing the old version of DevTools worked fine for me

If this is working for you to unblock your development workflow, then great. But please note that this is not guaranteed to work and may break other DevTools-related functionality in your IDE or in the browser.

Kindly note the issue exits also when open Network from DevTools in the web

If you are referring to Chrome DevTools, this is not Dart & Flutter DevTools and any issues with Chrome DevTools should be filed against that product.

I am taking about Flutter DevTools open it from VSCode Command Palette (Open DevTools in Web Browser) also have the same issue.

muhammadkamel avatar May 27 '25 20:05 muhammadkamel

Network logging after an app Hot Restart seems to be working at DevTools master branch. If anyone is keen on trying the Flutter main channel or Flutter 3.33.0-0.1.pre, this feature may be working there.

srawlins avatar May 28 '25 00:05 srawlins

This should be a problem with flutter devtools. It was normal in the previous version. In the latest version, no response may occur during the first startup, and hot restart may also occur. In addition, I did not use isolated thread-like code in my code.

maxfrees avatar May 28 '25 01:05 maxfrees