Skip to content

DevTools produces an error when opening in external tab on latest (master) SDK #3852

Closed

Description

@DanTup

When launching in an external window this error occurs:

[5:03:05 PM] [VmService] [Error] [Flutter (iPhone 13)] Error handling 'callService' custom request: 500 Failed to launch browser: type 'Null' is not a subtype of type 'String'
#0      DevToolsServer.launchDevTools (package:dds/devtools_server.dart:507:11)
#1      MachineModeCommandHandler.registerLaunchDevToolsService.<anonymous closure> (package:dds/src/devtools/machine_mode_command_handler.dart:378:26)
#2      MachineModeCommandHandler.registerLaunchDevToolsService.<anonymous closure> (package:dds/src/devtools/machine_mode_command_handler.dart:376:9)
#3      VmService._routeRequest (package:vm_service/src/vm_service.dart:2376:27)
#4      VmService._processRequest (package:vm_service/src/vm_service.dart:2346:25)
#5      VmService._processMessageStr (package:vm_service/src/vm_service.dart:2313:9)
#6      VmService._processMessage (package:vm_service/src/vm_service.dart:2271:7)
#7      _RootZone.runUnaryGuarded (dart:async/zone.dart:1618:10)
#8      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:34…
[5:03:05 PM] [General] [Error] DevTools failed to launch Chrome, will launch default browser locally instead: Failed to launch browser: type 'Null' is not a subtype of type 'String'
#0      DevToolsServer.launchDevTools (package:dds/devtools_server.dart:507:11)
#1      MachineModeCommandHandler.registerLaunchDevToolsService.<anonymous closure> (package:dds/src/devtools/machine_mode_command_handler.dart:378:26)
#2      MachineModeCommandHandler.registerLaunchDevToolsService.<anonymous closure> (package:dds/src/devtools/machine_mode_command_handler.dart:376:9)
#3      VmService._routeRequest (package:vm_service/src/vm_service.dart:2376:27)
#4      VmService._processRequest (package:vm_service/src/vm_service.dart:2346:25)
#5      VmService._processMessageStr (package:vm_service/src/vm_service.dart:2313:9)
#6      VmService._processMessage (package:vm_service/src/vm_service.dart:2271:7)
#7      _RootZone.runUnaryGuarded (dart:async/zone.dart:1618:10)
#8      _BufferingStreamSubscription._sendData (dart:async/stream_impl…

The issue appears to be that we're not passing page and this code is now null-safe and assumes a page. It's not clear from the docs before that null was really intended to be a valid value, so we should fix VS Code to always provide a page ID.

Activity

  1. added
    in commandsRelates to commands (usually invoked from the command Palette)
    on Mar 1, 2022
  2. added this to the v3.36.0 milestone on Mar 1, 2022
  3. added a commit that references this issue on Sep 2, 2025
    cc51ec4
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 bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions