build_runner failing with constantValue not defined for FieldElement class
kevinelliott opened this issue · comments
Precompiled build_runner:build_runner.
[INFO] Generating build script completed, took 600ms
[INFO] Creating build script snapshot... completed, took 11.6s
[SEVERE] Failed to snapshot build script .dart_tool/build/entrypoint/build.dart.
This is likely caused by a misconfigured builder definition.
[SEVERE] ../../../../../.pub-cache/hosted/pub.dartlang.org/angel_serialize_generator-2.5.0/lib/angel_serialize_generator.dart:104:55: Error: The getter 'constantValue' isn't defined for the class 'FieldElement'. - 'FieldElement' is from 'package:analyzer/dart/element/element.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/analyzer-0.41.1/lib/dart/element/element.dart').Try correcting the name to the name of an existing getter, or defining a getter or field named 'constantValue'. var value = type.element.getField(field.name).constantValue; ^^^^^^^^^^^^^../../../../../.pub-cache/hosted/pub.dartlang.org/angel_serialize_generator-2.5.0/lib/model.dart:88:43: Error: The getter 'type' isn't defined for the class 'ClassElement'. - 'ClassElement' is from 'package:analyzer/dart/element/element.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/analyzer-0.41.1/lib/dart/element/element.dart').Try correcting the name to the name of an existing getter, or defining a getter or field named 'type'. return !isAssignableToModel(ctx.clazz.type) && ^^^^../../../../../.pub-cache/hosted/pub.dartlang.org/angel_serialize_generator-2.5.0/lib/model.dart:211:18: Error: The getter 'typeParameters' isn't defined for the class 'InterfaceType'. - 'InterfaceType' is from 'package:analyzer/dart/element/type.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/analyzer-0.41.1/lib/dart/element/type.dart').Try correcting the name to the name of an existing getter, or defining a getter or field named 'typeParameters'. if (type.typeParameters.length == 1) { ^^^^^^^^^^^^^^../../../../../.pub-cache/hosted/pub.dartlang.org/angel_serialize_generator-2.5.0/lib/model.dart:219:18: Error: The getter 'typeParameters' isn't defined for the class 'InterfaceType'. - 'InterfaceType' is from 'package:analyzer/dart/element/type.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/analyzer-0.41.1/lib/dart/element/type.dart').Try correcting the name to the name of an existing getter, or defining a getter or field named 'typeParameters'. if (type.typeParameters.length == 2) { ^^^^^^^^^^^^^^../../../../../.pub-cache/hosted/pub.dartlang.org/angel_serialize_generator-2.5.0/lib/build_context.dart:68:20: Error: The getter 'type' isn't defined for the class 'ClassElement'. - 'ClassElement' is from 'package:analyzer/dart/element/element.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/analyzer-0.41.1/lib/dart/element/element.dart').Try correcting the name to the name of an existing getter, or defining a getter or field named 'type'. crawlClass(clazz.type); ^^^^../../../../../.pub-cache/hosted/pub.dartlang.org/angel_orm_generator-2.0.5/lib/src/migration_generator.dart:69:56: Error: The getter 'type' isn't defined for the class 'ClassElement'. - 'ClassElement' is from 'package:analyzer/dart/element/element.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/analyzer-0.41.1/lib/dart/element/element.dart').Try correcting the name to the name of an existing getter, or defining a getter or field named 'type'. .isAssignableFromType(ctx.buildContext.clazz.type); ^^^^../../../../../.pub-cache/hosted/pub.dartlang.org/angel_orm_generator-2.0.5/lib/src/orm_build_context.dart:28:64: Error: The getter 'type' isn't defined for the class 'ClassElement'. - 'ClassElement' is from 'package:analyzer/dart/element/element.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/analyzer-0.41.1/lib/dart/element/element.dart').Try correcting the name to the name of an existing getter, or defining a getter or field named 'type'. .isAssignableFromType(ctx.buildContext.clazz.type)); ^^^^../../../../../.pub-cache/hosted/pub.dartlang.org/angel_orm_generator-2.0.5/lib/src/orm_build_context.dart:262:47: Error: The getter 'typeProvider' isn't defined for the class 'AnalysisContext'. - 'AnalysisContext' is from 'package:analyzer/src/generated/engine.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/analyzer-0.41.1/lib/src/generated/engine.dart').Try correcting the name to the name of an existing getter, or defining a getter or field named 'typeProvider'. type = field.type.element.context.typeProvider.intType; ^^^^^^^^^^^^
Dart SDK version: 2.10.5 (stable) (Tue Jan 19 13:05:37 2021 +0100) on "macos_x64"
Also fails on 2.10.5 on Linux (destination for deployment).
pubspec.yaml
:
environment:
sdk: '>=2.10.0 <3.0.0'
dependencies:
args: ^1.5.2
angel_orm: ^2.0.2
angel_orm_postgres: ^1.0.0
convert:
json_annotation: ^3.0.1
nats:
git: https://github.com/c16a/nats-dart.git
quick_log: ^0.4.0
udp: ^3.0.2
# dart_json_mapper: ^1.5.20
async: 2.4.0
grpc: ^2.8.0
protobuf: ^1.1.0
dart_express: ^0.5.3
dev_dependencies:
angel_orm_generator: ^2.0.5
build_runner:
json_serializable: ^3.2.5
dependency_overrides:
http_multi_server: 2.2.0
postgres: 2.1.1