package:analyzer version 0.39.2 broken – missing dependency on package:kernel

Error: Could not resolve the package 'kernel' in 'package:kernel/util/graph.dart'.
../../.pub-cache/hosted/pub.dartlang.org/analyzer-0.39.2/lib/src/summary2/default_types_builder.dart:15:8: Error: Not found: 'package:kernel/util/graph.dart'
import 'package:kernel/util/graph.dart' show Graph, computeStrongComponents;
       ^
../../.pub-cache/hosted/pub.dartlang.org/analyzer-0.39.2/lib/src/summary2/default_types_builder.dart:256:39: Error: Type 'Graph' not found.
class _TypeParametersGraph implements Graph<int> {
                                      ^^^^^
../../.pub-cache/hosted/pub.dartlang.org/analyzer-0.39.2/lib/src/summary2/default_types_builder.dart:256:39: Error: Expected 0 type arguments.
class _TypeParametersGraph implements Graph<int> {
                                      ^
../../.pub-cache/hosted/pub.dartlang.org/analyzer-0.39.2/lib/src/summary2/default_types_builder.dart:125:29: Error: The method 'computeStrongComponents' isn't defined for the class 'DefaultTypesBuilder'.
 - 'DefaultTypesBuilder' is from 'package:analyzer/src/summary2/default_types_builder.dart' ('../../.pub-cache/hosted/pub.dartlang.org/analyzer-0.39.2/lib/src/summary2/default_types_builder.dart').
Try correcting the name to the name of an existing method, or defining a method named 'computeStrongComponents'.
    var stronglyConnected = computeStrongComponents(graph);

There is no dependency on kernel in the pubspec, but it imports it.

See also: #38497

Author: Fantashit

1 thought on “package:analyzer version 0.39.2 broken – missing dependency on package:kernel

  1. Pub should also be giving a warning on publish about this. dart-lang/pub#2214 would have prevented this from happening, but we should be paying close attention to warnings when publishing as well.

Comments are closed.