Home > Net >  dart pub global run webdev serve Building package executable... Failed to build webdev:webdev:
dart pub global run webdev serve Building package executable... Failed to build webdev:webdev:

Time:05-12

C:\flutter\bin (stable) λ dart pub global run webdev serve Building package executable... Failed to build webdev:webdev: /C:/Users/valen/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/dwds-12.1.1/lib/src/services/chrome_proxy_service.dart:540:24: Error: The method 'ChromeProxyService.getSourceReport' has fewer named arguments than those of overridden method 'VmServiceInterface.getSourceReport'. Future getSourceReport(String isolateId, List reports, ^ /C:/Users/valen/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/vm_service-8.3.0/lib/src/vm_service.dart:846:24: Context: This is the overridden method ('getSourceReport'). Future getSourceReport( ^ /C:/Users/valen/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/dwds-12.1.1/lib/src/services/chrome_proxy_service.dart:540:24: Error: The method 'ChromeProxyService.getSourceReport' doesn't have the named parameter 'libraryFilters' of overridden method 'VmServiceInterface.getSourceReport'. Future getSourceReport(String isolateId, List reports, ^ /C:/Users/valen/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/vm_service-8.3.0/lib/src/vm_service.dart:846:24: Context: This is the overridden method ('getSourceReport'). Future getSourceReport( ^

CodePudding user response:

I am getting the same thing today when I try and run my dart web app that worked yesterday. The only thing I changed was I updated Chrome to Version 101.0.4951.64 (Official Build) (64-bit)

Building package executable...
Failed to build webdev:webdev:
/C:/Users/mthomas/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/dwds-12.1.1/lib/src/services/chrome_proxy_service.dart:540:24: Error: The method 'ChromeProxyService.getSourceReport' has fewer named arguments than those of overridden method 'VmServiceInterface.getSourceReport'.
  Future<SourceReport> getSourceReport(String isolateId, List<String> reports,
                       ^
/C:/Users/mthomas/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/vm_service-8.3.0/lib/src/vm_service.dart:846:24: Context: This is the overridden method ('getSourceReport').
  Future<SourceReport> getSourceReport(
                       ^
/C:/Users/mthomas/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/dwds-12.1.1/lib/src/services/chrome_proxy_service.dart:540:24: Error: The method 'ChromeProxyService.getSourceReport' doesn't have the named parameter 'libraryFilters' of overridden method 'VmServiceInterface.getSourceReport'.
  Future<SourceReport> getSourceReport(String isolateId, List<String> reports,
/C:/Users/mthomas/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/dwds-12.1.1/lib/src/services/chrome_proxy_service.dart:540:24: Error: The method 'ChromeProxyService.getSourceReport' doesn't have the named parameter 'libraryFilters' of overridden method 'VmServiceInterface.getSourceReport'.
  Future<SourceReport> getSourceReport(String isolateId, List<String> reports,
                       ^
/C:/Users/mthomas/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/vm_service-8.3.0/lib/src/vm_service.dart:846:24: Context: This is the overridden method ('getSourceReport').
  Future<SourceReport> getSourceReport(
                       ^

CodePudding user response:

I ran into the same issue and found ChromeProxyService's implementation (dwds-12.1.1) doesn't match vm_service-8.3.0.

You can take a dirty fix as follows.

  1. Open chrome_proxy_service.dart in your pub directory (~/.pub-cache/hosted/pub.dartlang.org/vm_service-8.3.0)
  2. At line 540, add the missing argument: List<String> libraryFilters
  @override
  Future<SourceReport> getSourceReport(String isolateId, List<String> reports,
      {String scriptId,
      int tokenPos,
      int endTokenPos,
      bool forceCompile,
      bool reportLines,
      List<String> libraryFilters}) async {
  •  Tags:  
  • dart
  • Related