Repository navigation
DevTools fails to launch with a confusing message if Chrome is not installed #1830
Description
I was running app and asked me to
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)
Activity
DanTup commentedon Jul 4, 2019
Do you have Chrome installed? If so, what's the location it's installed at?
g-yashwanth commentedon 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 commentedon 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.
[-]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[/+][-]DevTools fails to launch if Chrome is not installed[/-][+]DevTools fails to launch with a confusing message if Chrome is not installed[/+]DanTup commentedon 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.
yanshouwang commentedon Jul 16, 2019
Is Microsoft's Edge insider which uses the chormium able to launch the DevTools? @DanTup
DanTup commentedon 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
measureStringon canvas). There's a little more info about the details of how this works at #1760 (comment).DanTup commentedon 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 bothchromeandgoogle-chrome-stableif that's common on Linux.I presume that although you see this error, it falls back to launching in your default browser?
DanTup commentedon 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
chrometogoogle-chrome-stable, though I think it might be better if it "just worked".DanTup commentedon Feb 13, 2020
Thanks for debugging and opening the issue. Once it's fixed in
browser_launcherand that change rolls into DevTools, it should start working without the link (and without any change needed here).Thanks!