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

DevTools fails to launch with a confusing message if Chrome is not installed #1830

Closed
g-yashwanth opened this issue Jul 4, 2019 · 14 comments
Labels
in commands Relates to commands (usually invoked from the command Palette) is enhancement
Milestone

Comments

@g-yashwanth
Copy link

I was running app and asked me to
bg
activate DevTools I just did it in vs code and some process was running and it popped up saying "The DevTools service failed to launch the browser. Please raise a bug against the Dart extension for VS Code. " and showed a bug report which is :

Failed to launch browser: ProcessException: The system cannot find the file specified.

Command: .\Google\Chrome\Application\chrome.exe http://127.0.0.1:56770/?hide=debugger&ide=VSCode&theme=dark&uri=http%3A%2F%2F127.0.0.1%3A57377%2FSVM_pXxEAVY%3D%2F
#0 Chrome._startProcess (package:browser_launcher/src/chrome.dart:128:12)

#1 Chrome.start (package:browser_launcher/src/chrome.dart:120:11)

#2 registerLaunchDevToolsService. (package:devtools_server/src/server.dart:238:24)

#3 VmService._routeRequest (package:vm_service_lib/vm_service_lib.dart:1631:39)

#4 VmService._processRequest (package:vm_service_lib/vm_service_lib.dart:1609:25)

#5 VmService._processMessageStr (package:vm_service_lib/vm_service_lib.dart:1577:9)
#6 VmService._processMessage (package:vm_service_lib/vm_service_lib.dart:1535:7)
#7 _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
#8 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#9 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#10 _SyncBroadcastStreamController._sendData (dart:async/broadcast_stream_controller.dart:375:20)
#11 _BroadcastStreamController.add (dart:async/broadcast_stream_controller.dart:250:5)
#12 _AsBroadcastStreamController.add (dart:async/broadcast_stream_controller.dart:474:11)
#13 _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
#14 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#15 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#16 _SyncStreamController._sendData (dart:async/stream_controller.dart:764:19)
#17 _StreamController._add (dart:async/stream_controller.dart:640:7)
#18 _StreamController.add (dart:async/stream_controller.dart:586:5)
#19 new _WebSocketImpl._fromSocket. (dart:_http/websocket_impl.dart:1138:21)
#20 _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
#21 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#22 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#23 _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:68:11)
#24 _EventSinkWrapper.add (dart:async/stream_transformers.dart:15:11)
#25 _WebSocketProtocolTransformer._messageFrameEnd (dart:_http/websocket_impl.dart:334:22)
#26 _WebSocketProtocolTransformer.add (dart:_http/websocket_impl.dart:229:46)
#27 _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:120:24)
#28 _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
#29 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#30 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#31 _SyncStreamController._sendData (dart:async/stream_controller.dart:764:19)
#32 _StreamController._add (dart:async/stream_controller.dart:640:7)
#33 _StreamController.add (dart:async/stream_controller.dart:586:5)
#34 _Socket._onData (dart:io-patch/socket_patch.dart:1774:41)
#35 _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
#36 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#37 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#38 _SyncStreamController._sendData (dart:async/stream_controller.dart:764:19)
#39 _StreamController._add (dart:async/stream_controller.dart:640:7)
#40 _StreamController.add (dart:async/stream_controller.dart:586:5)
#41 new _RawSocket. (dart:io-patch/socket_patch.dart:1323:33)
#42 _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:844:14)
#43 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#44 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#45 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:115:13)
#46 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:5)

@DanTup
Copy link
Member

DanTup commented Jul 4, 2019

Do you have Chrome installed? If so, what's the location it's installed at?

@DanTup DanTup added the awaiting info Requires more information from the customer to progress label Jul 4, 2019
@g-yashwanth
Copy link
Author

g-yashwanth commented Jul 5, 2019

no chrome isn't installed I use Mozilla, Will it only work on chrome, can't it work with Mozilla, cant we configure it

@DanTup
Copy link
Member

DanTup commented Jul 5, 2019

Unfortunately Dart DevTools currently only supports Chrome. There's some discussion about this at flutter/devtools#492 and related issues. The browser launching is done by DevTools itself, so not something that can be configured here.

If DevTools gets support for other browsers in future, I'll update the VS Code extension to take advantage of it.

@DanTup DanTup added upstream in dart / flutter Needs changing in Dart or Flutter and removed awaiting info Requires more information from the customer to progress labels Jul 5, 2019
@DanTup DanTup changed the title The DevTools service failed to launch the browser. Please raise a bug against the Dart extension for VS Code. DevTools fails to launch if Chrome is not installed Jul 8, 2019
@DanTup DanTup changed the title DevTools fails to launch if Chrome is not installed DevTools fails to launch with a confusing message if Chrome is not installed Jul 8, 2019
@DanTup DanTup closed this as completed in ba85435 Jul 8, 2019
@DanTup
Copy link
Member

DanTup commented Jul 8, 2019

I've tweaked this message to say "Dart DevTools was unable to launch Chrome" so it's clearer what's gone wrong.

I'll update this if DevTools gets support for other browsers.

@DanTup DanTup added this to the v3.3.0 milestone Jul 8, 2019
@DanTup DanTup added in commands Relates to commands (usually invoked from the command Palette) is enhancement and removed upstream in dart / flutter Needs changing in Dart or Flutter labels Jul 8, 2019
@yanshouwang
Copy link

Is Microsoft's Edge insider which uses the chormium able to launch the DevTools? @DanTup

@DanTup
Copy link
Member

DanTup commented Jul 16, 2019

I don't know enough to say whether it'd work - for example Brave is also based on Chromium but has issues rendering the tree (due to blocking measureString on canvas). There's a little more info about the details of how this works at #1760 (comment).

@ghost
Copy link

ghost commented Jan 30, 2020

I have chrome installed and I get this message on Manjaro Linux (based on Arch Linux) where it gets installed at /opt/google/chrome/chrome with a startup script also located at /usr/bin/google-chrome-stable.

@DanTup
Copy link
Member

DanTup commented Jan 31, 2020

@waynebloss my guess is that browser_launcher that DevTools uses to launch the browser doesn't find your executable as it is named google-chrome-stable. I think it may be worth raising an issue in browser_launcher to see if it could search for both chrome and google-chrome-stable if that's common on Linux.

I presume that although you see this error, it falls back to launching in your default browser?

@ghost
Copy link

ghost commented Jan 31, 2020

@DanTup Yes - chrome is my default so it just works. Thanks!

@DanTup
Copy link
Member

DanTup commented Jan 31, 2020

Great - we fall back to launching the default browser if DevTools fails. It's worth raising an issue with browser_launcher to see if they can check for both though (assuming this is common on Linux) to avoid the warning (and also so it would continue to work if Chrome wasn't your default browser).

Another option is to just symlink chrome to google-chrome-stable, though I think it might be better if it "just worked".

@ghost
Copy link

ghost commented Jan 31, 2020

Any idea where it's used? I searched this repo for browser_launcher and I couldn't find anything. I continued my search to find the source where this error happens and above that where it calls session.session.customRequest() however I don't see how that is mapped to the browser_launcher package.

Before I open an issue, I'd like to understand this.

@ghost
Copy link

ghost commented Jan 31, 2020

Soft linking /usr/bin/chrome -> /usr/bin/google-chrome-stable didn't seem to work. I'll keep trying later to see what does.

@ghost
Copy link

ghost commented Jan 31, 2020

I found it. It's trying to launch google-chrome so linking with that name works.

Failed to launch browser: ProcessException: No such file or directory
  Command: google-chrome http://127.0.0.1:9100/?hide=debugger&ide=VSCode&theme=dark&uri=http%3A%2F%2F127.0.0.1%3A38507%2F16GEBer2mu0%3D%2F
#0      Chrome._startProcess (package:browser_launcher/src/chrome.dart:130:12)
...

@DanTup
Copy link
Member

DanTup commented Feb 13, 2020

Thanks for debugging and opening the issue. Once it's fixed in browser_launcher and that change rolls into DevTools, it should start working without the link (and without any change needed here).

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in commands Relates to commands (usually invoked from the command Palette) is enhancement
Projects
None yet
Development

No branches or pull requests

3 participants