Skip to content

WEB: "flutter run -d chrome" crashes when using package with protobuf in dependencies #41544

@PavelPZ

Description

@PavelPZ

I am playing with flutter web (master channel version 1.10.7-pre.70) in vs code.

When my application app_io is using package app_main, which has protobuf reference in app_main/pubspec.yaml:

dependencies:
  protobuf:

than flutter run -d chrome crashes.

It is curious, that:

  • protobuf is not used in app_main package code, just referenced in app_main/pubspec.yaml
  • when I reference (or even use protobuf code) in app_io application, all is OK.

You can evoke an error in https://github.com/PavelPZ/protobuf_problem

flutter run -d chrome
Launching lib\main.dart on Chrome in debug mode...
Unhandled exception:
NoSuchMethodError: The getter 'name' was called on null.
Receiver: null
Tried calling: name
#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
#1      _packageBuildConfig.<anonymous closure> (package:build_runner_core/src/package_graph/target_graph.dart:85:61)
#2      MappedListIterable.elementAt (dart:_internal/iterable.dart:415:29)
#3      ListIterable.toList (dart:_internal/iterable.dart:219:19)
#4      new BuildConfig.useDefault (package:build_config/src/build_config.dart:90:34)
#5      BuildConfig.fromBuildConfigDir (package:build_config/src/build_config.dart:52:26)
<asynchronous suspension>
#6      _packageBuildConfig (package:build_runner_core/src/package_graph/target_graph.dart:90:30)
<asynchronous suspension>
#7      TargetGraph.forPackageGraph (package:build_runner_core/src/package_graph/target_graph.dart:37:17)
<asynchronous suspension>
#8      BuildOptions.create (package:build_runner_core/src/generate/options.dart:107:39)
<asynchronous suspension>
#9      BuildRunnerDaemonBuilder.create (package:build_runner/src/daemon/daemon_builder.dart:182:43)
<asynchronous suspension>
#10     DaemonCommand.run (package:build_runner/src/entrypoint/daemon.dart:83:48)
<asynchronous suspension>
#11     CommandRunner.runCommand (package:args/command_runner.dart:197:27)
<asynchronous suspension>
#12     CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:112:25)
#13     new Future.sync (dart:async/future.dart:224:31)
#14     CommandRunner.run (package:args/command_runner.dart:112:14)
#15     run (package:build_runner/src/entrypoint/run.dart:24:31)
<asynchronous suspension>
#16     main (package:flutter_tools/src/build_runner/build_script.dart:200:28)
<asynchronous suspension>
#17     _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:301:32)
#18     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)
Building application for the web...                                24.7s
Failed to build application for the web.

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: buildBuilding flutter applications with the toolc: crashStack traces logged to the consoleplatform-webWeb applications specificallyplatform-windowsBuilding on or for Windows specificallytoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions