Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flutter pub run build_runner build generates missing files and files that contain errors #3

Closed
talbiislam96 opened this issue Jul 6, 2021 · 0 comments

Comments

@talbiislam96
Copy link

talbiislam96 commented Jul 6, 2021

Hello @graphicbeacon , I followed your Graphql / flutter tutorial using my own GraphQL API , the pub run build_runner build command takes forever and it won't stop running until I hit ctr+c , also it generates files that contain errors due to some missing files ,
What seems to be the problem? I would appreciate some help thank you in advance.

// GENERATED CODE - DO NOT MODIFY BY HAND

import 'package:built_collection/built_collection.dart';
import 'package:built_value/built_value.dart';
import 'package:built_value/serializer.dart';
import 'package:gql_code_builder/src/serializers/default_scalar_serializer.dart'
    as _i1;

part 'schema.schema.gql.g.dart';

abstract class GDate implements Built<GDate, GDateBuilder> {
  GDate._();

  factory GDate([String value]) =>
      _$GDate((b) => value != null ? (b..value = value) : b);

  String get value;
  @BuiltValueSerializer(custom: true)
  static Serializer<GDate> get serializer => _i1.DefaultScalarSerializer<GDate>(
      (Object serialized) => GDate(serialized));
}

class GEntriesTimeSheet extends EnumClass {
  const GEntriesTimeSheet._(String name) : super(name);

  static const GEntriesTimeSheet FULLDAY = _$gEntriesTimeSheetFULLDAY;

  static const GEntriesTimeSheet HALFDAY = _$gEntriesTimeSheetHALFDAY;

  static const GEntriesTimeSheet HALFDAYHALFHOLIDAY =
      _$gEntriesTimeSheetHALFDAYHALFHOLIDAY;

  static const GEntriesTimeSheet NOWORK = _$gEntriesTimeSheetNOWORK;

  static const GEntriesTimeSheet OFF = _$gEntriesTimeSheetOFF;

  static Serializer<GEntriesTimeSheet> get serializer =>
      _$gEntriesTimeSheetSerializer;
  static BuiltSet<GEntriesTimeSheet> get values => _$gEntriesTimeSheetValues;
  static GEntriesTimeSheet valueOf(String name) =>
      _$gEntriesTimeSheetValueOf(name);
}










when I first run it it only generates this file which contain tons of errors, this the stack that I get in the terminal when I run the command:

[WARNING] Deleted previous snapshot due to missing asset graph.
[INFO] Creating build script snapshot......
[INFO] Creating build script snapshot... completed, took 10.9s

[INFO] Initializing inputs
[INFO] Building new asset graph...
[INFO] Building new asset graph completed, took 999ms

[INFO] Checking for unexpected pre-existing outputs....
[INFO] Checking for unexpected pre-existing outputs. completed, took 1ms

[INFO] Running build...
[WARNING] gql_build:serializer_builder on lib/$lib$:
Your current `analyzer` version may not fully support your current SDK version.

Please try upgrading to the latest `analyzer` by running `flutter packages upgrade`.

Analyzer language version: 2.10.0
SDK language version: 2.13.0

If you are getting this message and have the latest analyzer please file
an issue at https://github.com/dart-lang/sdk/issues/new with the title
"No published analyzer available for language version 2.13.0".
Please search the issue tracker first and thumbs up and/or subscribe to
existing issues if present to avoid duplicates.






Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant