flutter / devtools

Performance tools for Flutter
https://flutter.dev/docs/development/tools/devtools/
BSD 3-Clause "New" or "Revised" License
1.58k stars 326 forks source link

Dart Devtools not working after update. #2125

Closed azad47808 closed 3 years ago

azad47808 commented 4 years ago

This morning when I run Devtools I got an updating message and after update DevTools opened but shows nothing. this is my Devtools URL = http://127.0.0.1:9100/#?hide=debugger&ide=VSCode&theme=dark&uri=http%3A%2F%2F127.0.0.1%3A49683%2F7P9jVJjp0SU%3D%2F&page=inspector

My Flutter version is 1.19.0-4.1.pre My Dart version is 2.9.0 (build 2.9.0-14.1.beta).

devoncarew commented 4 years ago

How are you starting DevTools - from the command line, VS Code, IntelliJ?

bleonard252 commented 4 years ago

According to the link, VSCode. I'm experiencing the same thing running from the command line.

Another exception was thrown: Instance of 'minified:il<void>'

is being logged a lot.

azad47808 commented 4 years ago

How are you starting DevTools - from the command line, VS Code, IntelliJ?

From VS Code.

AlexanderTopchiy commented 4 years ago

I have the same problem with the same configurations (Flutter 1.19.0-4.2.pre, Dart 2.9, VS Code 1.46.1) after recent update DevTools. Also, it doesn't work from Android Studio 4.0 too. Both on Linux Debian 9.11. What happened?

ezbella commented 4 years ago

Same problem over here too. Tons of recurring exceptions: "Another exception was thrown: Instance of 'minified:im'" Could not load content for org-dartlang-sdk:///lib/_internal/js_runtime/lib/js_primitives.dart (HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME).

The app works perfectly fine in vs code on the device.

flutter doctor -v [√] Flutter (Channel stable, v1.17.4, on Microsoft Windows [Version 6.1.7601], locale es-AR) • Flutter version 1.17.4 at c:\flutter • Framework revision 1ad9baa8b9 (2 weeks ago), 2020-06-17 14:41:16 -0700 • Engine revision ee76268252 • Dart version 2.8.4

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.0) • Android SDK at C:\Users\xxx\AppData\Local\Android\sdk • Platform android-30, build-tools 30.0.0 • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01) • All Android licenses accepted.

[√] Android Studio (version 4.0) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin version 46.0.2 • Dart plugin version 193.7361 • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code (version 1.46.1) • VS Code at C:\Users\xxx\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.12.1

[√] Connected device (1 available) • Moto E 4 Plus • ZY2248P828 • android-arm • Android 7.1.1 (API 25)

• No issues found!

azad47808 commented 4 years ago

How are you starting DevTools - from the command line, VS Code, IntelliJ?

Can I downgrade Dart Devtools? because it happens after the update.

kenzieschmoll commented 4 years ago

Can you open DevTools from CLI? flutter pub global activate devtools; devtools

Trying to narrow this down to determine if the issue is specific to launching from VS code. Thanks.

DanTup commented 4 years ago

From this comment above it sounds like this may occur from Android Studio too.

Could it be caching from the old version? Does pressing Ctrl+R in the browser make any difference for those seeing this?

bleonard252 commented 4 years ago

Could it be caching from the old version? Does pressing Ctrl+R in the browser make any difference for those seeing this?

No, I haven't used DevTools in Chrome yet. I tried with Firefox and that didn't work (Firefox error).

azad47808 commented 4 years ago

Can you open DevTools from CLI? flutter pub global activate devtools; devtools

Trying to narrow this down to determine if the issue is specific to launching from VS code. Thanks.

I used these two commands but not worked it's just a white page.

1: flutter pub global activate devtools 2: flutter pub global run devtools

AlexanderTopchiy commented 4 years ago

Can you open DevTools from CLI? flutter pub global activate devtools; devtools

Trying to narrow this down to determine if the issue is specific to launching from VS code. Thanks.

I used this command before and now - still white page. (at http://127.0.0.1:9100) Both from VS Code and Android Studio. In Android Studio I can use embedded Flutter tabs - Inspector, Outline, Performance. And that's it.

kenzieschmoll commented 4 years ago

A couple things to try:

Are you running from Mac, Linux, or Windows?

ezbella commented 4 years ago

I have the latest Chrome version, specially downloaded for the occasion. I've tried everything you suggested with no luck

El mar., 7 de jul. de 2020 12:30 PM, Kenzie Schmoll < notifications@github.com> escribió:

A couple things to try:

  • make sure you are using the latest version of Chrome
  • clear your browser cache

Are you running from Mac, Linux, or Windows?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/flutter/devtools/issues/2125#issuecomment-654943663, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANFTWAVHYHUY6AMGWSJZ23TR2M5RRANCNFSM4OHZNMYA .

kenzieschmoll commented 4 years ago

Try appending '/#/' to the end of the url so that the url looks like http://127.0.0.1:9100/#/. The redirect is supposed to happen automatically.

ezbella commented 4 years ago

Tried it but did not work. The url: http://127.0.0.1:9100/#/?hide=debugger&ide=VSCode&theme=dark&uri=http%3A%2F%2F127.0.0.1%3A1485%2FtNRtGiM-E6k%3D%2F

kenzieschmoll commented 4 years ago

Try http://127.0.0.1:9100/#/?uri=http%3A%2F%2F127.0.0.1%3A1485%2FtNRtGiM-E6k%3D%2F

if that doesn't work try http://127.0.0.1:9100/#/ without any query parameters, and paste your URI into the connect dialog if it shows up http://127.0.0.1:1485/tNRtGiM-E6k=/

ezbella commented 4 years ago

image

Not working in any case :(

ezbella commented 4 years ago

image

With the last url you provided I could access the observatory, and now I can see at least this info of my app. But still without being able to access devtools...

elansys-kc commented 4 years ago

I have the same issue on Windows. logger_html.dart:10 PreferencesController: storage not initialized logger_html.dart:10 DevTools version 0.8.0+1. js_primitives.dart:47 js_primitives.dart:47 Another exception was thrown: Instance of 'minified:im' js_primitives.dart:47 Another exception was thrown: Instance of 'minified:im' js_primitives.dart:47 Another exception was thrown: Instance of 'minified:im' js_primitives.dart:47 Another exception was thrown: Instance of 'minified:im' js_primitives.dart:47 Another exception was thrown: Instance of 'minified:im'

Verbose log says: [Violation] 'requestAnimationFrame' handler took [various]ms js_helper.dart:1939

I have flutter web enabled

[√] Flutter (Channel dev, 1.20.0-3.0.pre, on Microsoft Windows [Version 10.0.18363.900], locale en-GB) • Flutter version 1.20.0-3.0.pre at C:\flutter • Framework revision 0af027f805 (5 days ago), 2020-07-04 12:19:20 -0700 • Engine revision a751393804 • Dart version 2.9.0 (build 2.9.0-20.0.dev 22da8934ac)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2) • Android SDK at C:\Users\work\AppData\Local\Android\sdk • Platform android-29, build-tools 29.0.2 • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01) • All Android licenses accepted.

[√] Chrome - develop for the web • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Android Studio (version 4.0) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin version 47.1.2 • Dart plugin version 193.7361 • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code (version 1.46.1) • VS Code at C:\Users\work\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.12.2

[√] Connected device (3 available) • Web Server (web) • web-server • web-javascript • Flutter Tools • Chrome (web) • chrome • web-javascript • Google Chrome 83.0.4103.116 • Edge (web) • edge • web-javascript • Microsoft Edge 83.0.478.61

heroqin commented 4 years ago

I have the same problem, nothing output in chrome browser: 图片

status bar in VSCode is as following: 图片

DanTup commented 4 years ago

I had a go at trying to repro on Windows, and could not. However I definitely saw some weird caching behaviour...

I first activated 0.2.5 and loaded and refreshed that. Then I activated 0.8.0+1, opened my browser and pasted in the URL. It loaded the old version of the app entirely:

devtools_1

I pressed F5 to refresh, and it still showed the old version:

devtools_2_after_f5

I pressed F5 a second time, and the new version loaded:

devtools_3_after_f5_again

I tried a few times but couldn't repro the error above - though I wonder if it's possible for some of the files to come from the cache and not all?

To those that can reproduce this reliably - if you deliberately run on a different port, eg:

pub global run devtools --port 9120

does this make any difference?

heroqin commented 4 years ago

When I execute 'pub global run devtools --port 9120', it says: 图片

heroqin commented 4 years ago

I use the following command instead: 图片 and open chrome: http://127.0.0.1:9120/#/, but it still output blank: 图片

elansys-kc commented 4 years ago

It runs from the commandline, when I follow these instructions but not from vscode or Android studio. https://github.com/flutter/devtools/blob/master/CONTRIBUTING.md

I often get run -d chrome|edge failures like the following which makes me wonder if a timeout is occurring and if a timeout could be happening on devtools that might affect the GUI tools more without the manual steps?

My machine is older without an SSD, does anyone with this issue have a newer machine, with an SSD?


PS C:\flutter_proj\review> cd gallery PS C:\flutter_proj\review\gallery> flutter run -d edge Running "flutter pub get" in gallery... 73.1s Launching lib\main.dart on Edge in debug mode... Syncing files to device Edge... 119,368ms (!) Failed to establish connection with the application instance in Chrome. This can happen if the websocket connection used by the web tooling is unable to correctly establish a connection, for example due to a firewall. PS C:\flutter_proj\review\gallery> flutter run -d edge Launching lib\main.dart on Edge in debug mode... Syncing files to device Edge... 83,968ms (!) Debug service listening on ws://127.0.0.1:51696/sQjV4xXUWZU=

Warning: Flutter's support for web development is not stable yet and hasn't been thoroughly tested in production environments. For more information see https://flutter.dev/web

To hot restart changes while running, press "r" or "R". For a more detailed help message, press "h". To quit, press "q".

jacob314 commented 4 years ago

I've uploaded devtools 0.8.0+2 which should provide a slightly better error message as minification is turned off. Please let me know if you are able to reproduce the error while running 0.8.0+2. The error message may help us debug the issue.

heroqin commented 4 years ago

@jacob314 I upgraded devtools version to 0.8.0+2, and tried it, but still nothing output. but where can I get the error message? By the way, I try to telnet 127.0.0.1 9100, it did response. 图片

DanTup commented 4 years ago

@heroqin the error will show in the Chrome developer tools. To open them, press F12 in the blank Chrome window and then click the Console tab and there's probably a red error message. Please post that message here - hopefully it will be more helpful than the minified one.

heroqin commented 4 years ago

图片 the number before "Another exception was thrown: Instance of 'ErrorSummary'" is added 1 per second: 图片 图片 图片

DanTup commented 4 years ago

@heroqin could you try clicking on the Sources tab in those developer tools, then on the right side ticking the box that says "Pause on caught exceptions" and see whether that causes the debugger to break? If so, please include a screenshot (including the Call Stack and exception info).

ezbella commented 4 years ago

Hi @DanTup, I'm attaching the screenshot you requested. Tell me if you need anything else.

image

image

heroqin commented 4 years ago

图片

jacob314 commented 4 years ago

@hterkelsen any advice on what we can do to avoid this crash in CanvasKit. Surprisingly it only reproduces for some users.

jacob314 commented 4 years ago

It appears that creating a webgl context may be failing. Do any WebGL apps work in your browser? For example: can you pleas try a sample from https://webglsamples.org/

ezbella commented 4 years ago

I've tried 5 random samples. Every one of them worked.

image

jacob314 commented 4 years ago

Thanks for all your help debugging this. One more test to try: https://flutter-dashboard.appspot.com/#/build is also a canvaskit based flutter web app. Do you get the same exception when you run it or do you see something like this?

Screen Shot 2020-07-16 at 11 35 15 AM
yjbanov commented 4 years ago

@DanTup I think what you are observing is an issue with the service worker caching a little too aggressively. You may need a hard page reload to get the latest version (Cmd + Shift + R, or Ctrl + Shift + R).

jacob314 commented 4 years ago

@yjbanov, Is there a bug filed on the service working caching too aggressively? I'm guessing we want to use the service worker to make sure canvaskit is cached efficiently but we don't care about it for the rest of the appp as we are always running on localhost.

ezbella commented 4 years ago

@jacob314 A pleasure to help. Thank you guys for these amazing features! Same error is throwing in the web flutter app.

image

jacob314 commented 4 years ago

Thanks @ezbella! Can you provide some more details about what version of chrome you are using, what operating system you are running, and what video card you are using? You might want to try disabling all extensions just in case some extension is interacting badly with CanvasKit but that is unlikely.

fyi @hterkelsen it is confirmed that CanvasKit fails for all Flutter Web applications but strangely other WebGL samples succeed.

The next step on our end is to detect this crash and and fallback to the non-canvaskit renderer which is slower but works on more platforms.

heroqin commented 4 years ago

Hi @jacob314 I've test https://flutter-dashboard.appspot.com/#/build, in chrome, nothing output and error got: 图片

but in firefox, it seems normal! : 图片

chrome version: 版本 84.0.4147.89(正式版本) (64 位) OS: 图片 video card: 图片 I think chrome use Intel HD graphic 520

heroqin commented 4 years ago

Since firefox work well on https://flutter-dashboard.appspot.com/#/build. I tried to open http://127.0.0.1:9100/#/ using firefox, it works! : 图片

图片

ezbella commented 4 years ago

hi @jacob314! i share the info you requested: Chrome: (btw not using any extension, just a clean installation) image

Windows Version: flutter doctor -v [√] Flutter (Channel stable, v1.17.4, on Microsoft Windows [Version 6.1.7601], locale es-AR) • Flutter version 1.17.4 at c:\flutter • Framework revision 1ad9baa8b9 (2 weeks ago), 2020-06-17 14:41:16 -0700 • Engine revision ee76268252 • Dart version 2.8.4

Video Card: (running on a Lenovo T430 series) image

As a side note, i tried what @heroqin suggested and the flutter web app also worked in firefox.

jacob314 commented 4 years ago

Thanks @ezbella and @heroqin. That is great news that it works on FireFox. We'll make devtools detect the error and provide an option to relaunch the app in FireFox if it occurs.

ezbella commented 4 years ago

@jacob314 You are mosltly welcome! Just ask if you need anything else.

ynaiborlang commented 4 years ago

hi @jacob314 https://flutter-dashboard.appspot.com/#/build does not work on firefox for me, got the same console error, using the latest version of FF

azad47808 commented 4 years ago

I changed my windows, but still not working. and https://flutter-dashboard.appspot.com/#/build work properly.

Capture

jacob314 commented 4 years ago

@azad47808 sorry to hear that. Can you provide details on your chrome version, operating system, and machine (e.g Lenovo T430)? Can you also provide a screenshot of what errors you see in chrome devtools when Dart DevTools does not work correctly? It could be you are seeing a different issue.

elansys-kc commented 4 years ago

Ignore deleted previous. I had a js filter extension enabled (umatrix)

Mines a T410. I had exactly the same error on Windows as on Linux.

In firefox on Linux I get

Another exception was thrown: Instance of 'ErrorSummary' main.dart.js:5574:17 Error: WebGL warning: : Failed to create WebGL context: WebGL creation failed:

I now get different console output on Linux with Chrome Version 84.0.4147.89.

PreferencesController: storage not initialized logger_html.dart:10 DevTools version 0.8.0+2. js_helper.dart:1857 [Violation] 'setTimeout' handler took 437ms js_primitives.dart:47 ══╡ ╞══════════════════════════════════════════════════════════════════════════════════════════════ js_primitives.dart:47 ════════════════════════════════════════════════════════════════════════════════════════════════════ js_helper.dart:1857 [Violation] 'setTimeout' handler took 153ms html_dart2js.dart:23739 [Violation] Only request notification permission in response to a user gesture. Notification__requestPermission @ html_dart2js.dart:23739 Notification_requestPermission @ html_dart2js.dart:23745 _handleMethod$2 @ notifications_web.dart:15 _handleMessage$1 @ server_api_client.dart:116 call$1 @ server_api_client.dart:22 runUnaryGuarded$1$2 @ zone.dart:1384 runUnaryGuarded$2 @ zone.dart:1381 _sendData$1 @ stream_impl.dart:357 perform$1 @ stream_impl.dart:611 handleNext$1 @ stream_impl.dart:730 call$0 @ stream_impl.dart:687 _microtaskLoop @ schedule_microtask.dart:41 _startMicrotaskLoop @ schedule_microtask.dart:50 call$1 @ async_patch.dart:49 invokeClosure @ js_helper.dart:1825 (anonymous) @ js_helper.dart:1857 6js_primitives.dart:47 Another exception was thrown: Instance of 'ErrorSummary' 250[Violation] 'requestAnimationFrame' handler took ms 8js_primitives.dart:47 Another exception was thrown: Instance of 'ErrorSummary' 2js_primitives.dart:47 Another exception was thrown: Instance of 'ErrorSummary' js_helper.dart:1857 [Violation] 'setTimeout' handler took 150ms 4218js_primitives.dart:47 Another exception was thrown: Instance of 'ErrorSummary'

azad47808 commented 4 years ago

I don't know what happened. But now it working right.

elansys-kc commented 4 years ago

Disabling hw acceleration in Chrome under advanced settings, works around it. Might be the better fix for other possibly broken canvas pages too, not sure?

On a side note, on the same hw flutter development was a little slow waiting for the files to sync to chrome without an SSD. Not sure if Linux being configured to handle smaller files would have helped there or not. This might be a performance metric that goes unnoticed by devs. I think that SSD use may have worsened the HDD case for windows update speed issues, incidentally.