gibahjoe / openapi-generator-dart

Openapi Generator for Dart/Flutter
BSD 3-Clause "New" or "Revised" License
123 stars 34 forks source link

Cannot run build runner #86

Open clotodex opened 1 year ago

clotodex commented 1 year ago

[INFO] Generating build script...
[INFO] Generating build script completed, took 319ms

[INFO] Precompiling build script......
[WARNING] ../../../../../../.pub-cache/hosted/pub.dev/go_router_builder-1.1.7/lib/src/route_config.dart:94:57: Error: The getter 'element' isn't defined for the class 'InterfaceType'.
 - 'InterfaceType' is from 'package:analyzer/dart/element/type.dart' ('../../../../../../.pub-cache/hosted/pub.dev/analyzer-5.0.0/lib/dart/element/type.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
    final InterfaceElement classElement = typeParamType.element;
                                                        ^^^^^^^
../../../../../../.pub-cache/hosted/pub.dev/go_router_builder-1.1.7/lib/src/route_config.dart:403:32: Error: The getter 'element' isn't defined for the class 'InterfaceType'.
 - 'InterfaceType' is from 'package:analyzer/dart/element/type.dart' ('../../../../../../.pub-cache/hosted/pub.dev/analyzer-5.0.0/lib/dart/element/type.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
  final String enumName = type.element.name;
                               ^^^^^^^
../../../../../../.pub-cache/hosted/pub.dev/go_router_builder-1.1.7/lib/src/route_config.dart:410:45: Error: The getter 'element' isn't defined for the class 'InterfaceType'.
 - 'InterfaceType' is from 'package:analyzer/dart/element/type.dart' ('../../../../../../.pub-cache/hosted/pub.dev/analyzer-5.0.0/lib/dart/element/type.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
  for (final FieldElement enumField in type.element.fields
                                            ^^^^^^^
../../../../../../.pub-cache/hosted/pub.dev/go_router_builder-1.1.7/lib/src/type_helpers.dart:93:54: Error: The getter 'element' isn't defined for the class 'InterfaceType'.
 - 'InterfaceType' is from 'package:analyzer/dart/element/type.dart' ('../../../../../../.pub-cache/hosted/pub.dev/analyzer-5.0.0/lib/dart/element/type.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
String enumMapName(InterfaceType type) => '_\$${type.element.name}EnumMap';
                                                     ^^^^^^^
[INFO] Precompiling build script... completed, took 5.4s

[SEVERE] Failed to precompile build script .dart_tool/build/entrypoint/build.dart.
This is likely caused by a misconfigured builder definition.

Adding the analyzer 1.0.0 just breaks the build runner completely.

Running flutter version:

Flutter 3.7.8 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 90c64ed42b (9 days ago) • 2023-03-21 11:27:08 -0500
Engine • revision 9aa7816315
Tools • Dart 2.19.5 • DevTools 2.20.1