Skip to content

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

Closed

Description

@g-yashwanth

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)

Activity

  1. DanTup commented on Jul 4, 2019

    @DanTup
    Member

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

  2. added
    awaiting infoRequires more information from the customer to progress
    on Jul 4, 2019
  3. g-yashwanth commented on Jul 5, 2019

    @g-yashwanth
    Author

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

  4. DanTup commented on Jul 5, 2019

    @DanTup
    Member

    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.

  5. added and removed
    awaiting infoRequires more information from the customer to progress
    on Jul 5, 2019
  6. 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[/+] on Jul 8, 2019
  7. 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[/+] on Jul 8, 2019
  8. DanTup commented on Jul 8, 2019

    @DanTup
    Member

    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.

  9. added this to the v3.3.0 milestone on Jul 8, 2019
  10. added
    in commandsRelates to commands (usually invoked from the command Palette)
    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
    and removed on Jul 8, 2019
  11. yanshouwang commented on Jul 16, 2019

    @yanshouwang

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

  12. DanTup commented on Jul 16, 2019

    @DanTup
    Member

    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).

  13. DanTup commented on Jan 31, 2020

    @DanTup
    Member

    @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?

  14. DanTup commented on Jan 31, 2020

    @DanTup
    Member

    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".

  15. DanTup commented on Feb 13, 2020

    @DanTup
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    in commandsRelates to commands (usually invoked from the command Palette)is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions