VeryGoodOpenSource / dart_frog

A fast, minimalistic backend framework for Dart 🎯
https://dartfrog.vgv.dev
MIT License
1.87k stars 150 forks source link

fix: dart_frog CLI breaks after upgrading Flutter/Dart #1472

Closed MickaelHrndz closed 3 months ago

MickaelHrndz commented 3 months ago

Description

After upgrading to Flutter 3.24.0 (Dart 3.5.0), the dart_frog CLI broke for me. I tried upgrading everything and reinstalling it but it keeps returning the same errors.

Steps To Reproduce

On Windows 11, with Flutter master channel:

  1. flutter upgrade

  2. dart_frog

  3. It outputs this:

    Can't load Kernel binary: Invalid kernel binary format version.
    Building package executable... 
    Failed to build dart_frog_cli:dart_frog:
    /C:/Users/Micki/AppData/Local/Pub/Cache/hosted/pub.dev/archive-3.4.10/lib/src/bzip2/bzip2.dart:5:7: Error: Method not found: 'UnmodifiableUint8ListView'.
      UnmodifiableUint8ListView(Uint8List(0));
      ^^^^^^^^^^^^^^^^^^^^^^^^^
    /C:/Users/Micki/AppData/Local/Pub/Cache/hosted/pub.dev/archive-3.4.10/lib/src/bzip2/bzip2.dart:7:7: Error: Method not found: 'UnmodifiableUint32ListView'.
      UnmodifiableUint32ListView(Uint32List(0));
      ^^^^^^^^^^^^^^^^^^^^^^^^^^
    /C:/Users/Micki/AppData/Local/Pub/Cache/hosted/pub.dev/archive-3.4.10/lib/src/bzip2/bzip2.dart:9:7: Error: Method not found: 'UnmodifiableInt32ListView'.
      UnmodifiableInt32ListView(Int32List(0));
      ^^^^^^^^^^^^^^^^^^^^^^^^^
    /C:/Users/Micki/AppData/Local/Pub/Cache/hosted/pub.dev/win32-5.2.0/lib/src/guid.dart:32:9: Error: Type 'UnmodifiableUint8ListView' not found.
    final UnmodifiableUint8ListView bytes;
        ^^^^^^^^^^^^^^^^^^^^^^^^^
    /C:/Users/Micki/AppData/Local/Pub/Cache/hosted/pub.dev/win32-5.2.0/lib/src/guid.dart:32:9: Error: 'UnmodifiableUint8ListView' isn't a type.
    final UnmodifiableUint8ListView bytes;
        ^^^^^^^^^^^^^^^^^^^^^^^^^
    /C:/Users/Micki/AppData/Local/Pub/Cache/hosted/pub.dev/win32-5.2.0/lib/src/guid.dart:52:17: Error: Method not found: 'UnmodifiableUint8ListView'.
    return Guid(UnmodifiableUint8ListView(guid));
                ^^^^^^^^^^^^^^^^^^^^^^^^^
    /C:/Users/Micki/AppData/Local/Pub/Cache/hosted/pub.dev/win32-5.2.0/lib/src/guid.dart:56:31: Error: Method not found: 'UnmodifiableUint8ListView'.
    factory Guid.zero() => Guid(UnmodifiableUint8ListView(Uint8List(16)));
                              ^^^^^^^^^^^^^^^^^^^^^^^^^
    /C:/Users/Micki/AppData/Local/Pub/Cache/hosted/pub.dev/win32-5.2.0/lib/src/guid.dart:100:17: Error: Method not found: 'UnmodifiableUint8ListView'.
    return Guid(UnmodifiableUint8ListView(Uint8List.fromList(guidAsBytes)));
                ^^^^^^^^^^^^^^^^^^^^^^^^^
  4. dart pub global activate dart_frog_cli

  5. Now dart_frog responds correctly, but dart_frog dev still outputs this:

⠧ Serving... (2.2s)Unable to compile hook: C:\Users\Micki\AppData\Local\Mason\Cache\bun.
Error: /C:/Users/Micki/AppData/Local/Pub/Cache/hosted/pub.dev/archive-3.4.10/lib/src/bz.
      UnmodifiableUint8ListView(Uint8List(0));
      ^^^^^^^^^^^^^^^^^^^^^^^^^
/C:/Users/Micki/AppData/Local/Pub/Cache/hosted/pub.dev/archive-3.4.10/lib/src/bzip2/bzi.
      UnmodifiableUint32ListView(Uint32List(0));
      ^^^^^^^^^^^^^^^^^^^^^^^^^^
/C:/Users/Micki/AppData/Local/Pub/Cache/hosted/pub.dev/archive-3.4.10/lib/src/bzip2/bzi.
      UnmodifiableInt32ListView(Int32List(0));
      ^^^^^^^^^^^^^^^^^^^^^^^^^
/C:/Users/Micki/AppData/Local/Pub/Cache/hosted/pub.dev/win32-5.2.0/lib/src/guid.dart:32.
  final UnmodifiableUint8ListView bytes;
        ^^^^^^^^^^^^^^^^^^^^^^^^^
/C:/Users/Micki/AppData/Local/Pub/Cache/hosted/pub.dev/win32-5.2.0/lib/src/guid.dart:32.
  final UnmodifiableUint8ListView bytes;
        ^^^^^^^^^^^^^^^^^^^^^^^^^
/C:/Users/Micki/AppData/Local/Pub/Cache/hosted/pub.dev/win32-5.2.0/lib/src/guid.dart:52.
    return Guid(UnmodifiableUint8ListView(guid));
                ^^^^^^^^^^^^^^^^^^^^^^^^^
/C:/Users/Micki/AppData/Local/Pub/Cache/hosted/pub.dev/win32-5.2.0/lib/src/guid.dart:56.
  factory Guid.zero() => Guid(UnmodifiableUint8ListView(Uint8List(16)));
                              ^^^^^^^^^^^^^^^^^^^^^^^^^
/C:/Users/Micki/AppData/Local/Pub/Cache/hosted/pub.dev/win32-5.2.0/lib/src/guid.dart:10.
    return Guid(UnmodifiableUint8ListView(Uint8List.fromList(guidAsBytes)));
                ^^^^^^^^^^^^^^^^^^^^^^^^^
Bad state: Generating kernel failed!

Expected Behavior

I expect the dart_frog CLI to keep working after upgrading the stable Dart version.

lightlitebug commented 3 months ago

After encountering the same error as the one mentioned above, I ran the dart pub cache clean and dart pub get commands. Next, I reinstalled the dart_frog_cli and ran the dart_frog dev command, and the error shown above disappeared, but I got another error as shown below. This happens after upgrading to dart 3.5.0.

Unable to compile hook: /Users/sangwookcho/.mason-cache/bundled/dart_.
Error: ../../../../../.mason-cache/bundled/dart_frog_dev_server_0.1.0+1_36e9c7850709dd75.
  final logger = Logger();
                 ^^^^^^
../../../../../.mason-cache/bundled/dart_frog_dev_server_0.1.0+1_36e9c7850709dd7585d2836.
        '''Route conflict detected. ${lightCyan.wrap(originalFilePath)} and ${lightCyan.,
                                      ^^^^^^^^^
../../../../../.mason-cache/bundled/dart_frog_dev_server_0.1.0+1_36e9c7850709dd7585d2836.
        '''Route conflict detected. ${lightCyan.wrap(originalFilePath)} and ${lightCyan.,
                                                                              ^^^^^^^^^
../../../../../.mason-cache/bundled/dart_frog_dev_server_0.1.0+1_36e9c7850709dd7585d2836.
        '''Route conflict detected. ${lightCyan.wrap(originalFilePath)} and ${lightCyan.,
                                                                                        ^
../../../../../.mason-cache/bundled/dart_frog_dev_server_0.1.0+1_36e9c7850709dd7585d2836.
        '''Rogue route detected.${defaultForeground.wrap(' ')}Rename ${lightCyan.wrap(fi,
                                  ^^^^^^^^^^^^^^^^^
../../../../../.mason-cache/bundled/dart_frog_dev_server_0.1.0+1_36e9c7850709dd7585d2836.
        '''Rogue route detected.${defaultForeground.wrap(' ')}Rename ${lightCyan.wrap(fi,
                                                                       ^^^^^^^^^
../../../../../.mason-cache/bundled/dart_frog_dev_server_0.1.0+1_36e9c7850709dd7585d2836.
        '''Rogue route detected.${defaultForeground.wrap(' ')}Rename ${lightCyan.wrap(fi,
                                                                                        ^
../../../../../.pub-cache/hosted/pub.dev/async-2.11.0/lib/src/sink_base.dart:8:8: Error:y
import 'package:meta/meta.dart';
       ^
../../../../../.pub-cache/hosted/pub.dev/async-2.11.0/lib/src/sink_base.dart:29:4: Error.
  @visibleForOverriding
   ^^^^^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/async-2.11.0/lib/src/sink_base.dart:29:4: Error.
  @visibleForOverriding
   ^
../../../../../.pub-cache/hosted/pub.dev/async-2.11.0/lib/src/sink_base.dart:39:4: Error.
  @visibleForOverriding
   ^^^^^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/async-2.11.0/lib/src/sink_base.dart:39:4: Error.
  @visibleForOverriding
   ^
../../../../../.pub-cache/hosted/pub.dev/async-2.11.0/lib/src/sink_base.dart:51:4: Error.
  @visibleForOverriding
   ^^^^^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/async-2.11.0/lib/src/sink_base.dart:51:4: Error.
  @visibleForOverriding
   ^
../../../../../.pub-cache/hosted/pub.dev/async-2.11.0/lib/src/sink_base.dart:137:4: Erro.
  @visibleForOverriding
   ^^^^^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/async-2.11.0/lib/src/sink_base.dart:137:4: Erro.
  @visibleForOverriding
   ^
../../../../../.pub-cache/hosted/pub.dev/async-2.11.0/lib/src/stream_closer.dart:7:8: Ery
import 'package:meta/meta.dart';
       ^
../../../../../.pub-cache/hosted/pub.dev/async-2.11.0/lib/src/stream_closer.dart:20:2: E.
@sealed
 ^^^^^^
../../../../../.pub-cache/hosted/pub.dev/async-2.11.0/lib/src/stream_closer.dart:20:2: E.
@sealed
 ^
../../../../../.pub-cache/hosted/pub.dev/checked_yaml-2.0.3/lib/checked_yaml.dart:5:8: Ey
import 'package:json_annotation/json_annotation.dart';
       ^
../../../../../.pub-cache/hosted/pub.dev/checked_yaml-2.0.3/lib/checked_yaml.dart:57:3: .
  CheckedFromJsonException exception, {
  ^^^^^^^^^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/checked_yaml-2.0.3/lib/checked_yaml.dart:47:8: .
  } on CheckedFromJsonException catch (e) {
       ^^^^^^^^^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/checked_yaml-2.0.3/lib/checked_yaml.dart:57:3: .
  CheckedFromJsonException exception, {
  ^^^^^^^^^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/checked_yaml-2.0.3/lib/checked_yaml.dart:65:32:.
    final key = (innerError is UnrecognizedKeysException)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/equatable-2.0.5/lib/src/equatable.dart:1:8: Erry
import 'package:meta/meta.dart';
       ^
../../../../../.pub-cache/hosted/pub.dev/equatable-2.0.5/lib/src/equatable.dart:20:2: Er.
@immutable
 ^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/equatable-2.0.5/lib/src/equatable.dart:20:2: Er.
@immutable
 ^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/mason.dart:7:1: Error: Ey
export 'package:mason_logger/mason_logger.dart';
^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/brick_yaml.dart:3:8:y
import 'package:json_annotation/json_annotation.dart';
       ^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/brick_yaml.dart:4:8:y
import 'package:meta/meta.dart';
       ^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/brick_yaml.dart:278:.
    implements JsonConverter<Map<String, BrickVariableProperties>, dynamic> {
               ^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/brick_yaml.dart:12:2.
@immutable
 ^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/brick_yaml.dart:12:2.
@immutable
 ^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/brick_yaml.dart:13:2.
@JsonSerializable()
 ^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/brick_yaml.dart:66:4.
  @JsonKey(name: 'publish_to')
   ^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/brick_yaml.dart:118:.
  @JsonValue('enum')
   ^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/brick_yaml.dart:130:.
@immutable
 ^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/brick_yaml.dart:130:.
@immutable
 ^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/brick_yaml.dart:131:.
@JsonSerializable()
 ^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/brick_yaml.dart:134:.
  @internal
   ^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/brick_yaml.dart:134:.
  @internal
   ^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/brick_yaml.dart:253:.
  @JsonKey(name: 'default')
   ^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/brick_yaml.dart:258:.
  @JsonKey(name: 'defaults')
   ^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/brick_yaml.dart:311:.
@immutable
 ^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/brick_yaml.dart:311:.
@immutable
 ^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/brick_yaml.dart:312:.
@JsonSerializable()
 ^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/brick_yaml.g.dart:13.
        $checkKeys(
        ^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/brick_yaml.g.dart:9:.
BrickYaml _$BrickYamlFromJson(Map json) => $checkedCreate(
                                           ^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/brick_yaml.g.dart:75.
        $checkKeys(
        ^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/brick_yaml.g.dart:89.
              'type', (v) => $enumDecode(_$BrickVariableTypeEnumMap, v)),
                             ^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/brick_yaml.g.dart:71.
    $checkedCreate(
    ^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/brick_yaml.g.dart:14.
        $checkKeys(
        ^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/brick_yaml.g.dart:13.
BrickEnvironment _$BrickEnvironmentFromJson(Map json) => $checkedCreate(
                                                         ^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/bricks_json.dart:8:8y
import 'package:meta/meta.dart';
       ^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/bricks_json.dart:5:8y
import 'package:http/http.dart' as http;
       ^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/bricks_json.dart:94:.
  @visibleForTesting
   ^^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/bricks_json.dart:94:.
  @visibleForTesting
   ^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/bricks_json.dart:99:.
  @visibleForTesting
   ^^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/bricks_json.dart:99:.
  @visibleForTesting
   ^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/bricks_json.dart:349.
    late final http.Response response;
                    ^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/bricks_json.dart:351.
      response = await http.get(uri);
                            ^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/bricks_json.dart:412.
    final response = await http.get(uri);
                                ^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/generator.dart:12:8:y
import 'package:meta/meta.dart';
       ^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/generator.dart:10:8:y
import 'package:http/http.dart' as http;
       ^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/generator.dart:216:5.
    Logger? logger,
    ^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/generator.dart:338:5.
    Logger? logger,
    ^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/generator.dart:423:5.
    Logger? logger,
    ^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/generator.dart:522:2.
@immutable
 ^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/generator.dart:522:2.
@immutable
 ^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/generator.dart:216:5.
    Logger? logger,
    ^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/generator.dart:277:3.
      final response = await http.Client().get(uri);
                                  ^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/generator.dart:338:5.
    Logger? logger,
    ^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/generator.dart:343:2.
 - 'DirectoryGeneratorTarget' is from 'package:mason/src/generator.dart' ('../../../../..
Try correcting the name to the name of an existing getter, or defining a getter or field.
    final filePath = darkGray.wrap(p.relative(file.path));
                     ^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/generator.dart:351:4.
 - 'DirectoryGeneratorTarget' is from 'package:mason/src/generator.dart' ('../../../../..
Try correcting the name to the name of an existing getter, or defining a getter or field.
            () => logger?.delayed('  ${green.wrap('created')} $filePath'),
                                       ^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/generator.dart:359:2.
 - 'DirectoryGeneratorTarget' is from 'package:mason/src/generator.dart' ('../../../../..
Try correcting the name to the name of an existing getter, or defining a getter or field.
      logger?.delayed('  ${cyan.wrap('identical')} $filePath');
                           ^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/generator.dart:369:2.
 - 'DirectoryGeneratorTarget' is from 'package:mason/src/generator.dart' ('../../../../..
Try correcting the name to the name of an existing getter, or defining a getter or field.
      logger.info('${red.wrap(styleBold.wrap('conflict'))} $filePath');
                     ^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/generator.dart:369:3.
 - 'DirectoryGeneratorTarget' is from 'package:mason/src/generator.dart' ('../../../../..
Try correcting the name to the name of an existing getter, or defining a getter or field.
      logger.info('${red.wrap(styleBold.wrap('conflict'))} $filePath');
                              ^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/generator.dart:372:1.
 - 'DirectoryGeneratorTarget' is from 'package:mason/src/generator.dart' ('../../../../..
Try correcting the name to the name of an existing getter, or defining a getter or field.
            lightYellow.wrap('Overwrite ${p.basename(file.path)}? (Yyna)'),
            ^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/generator.dart:380:3.
 - 'DirectoryGeneratorTarget' is from 'package:mason/src/generator.dart' ('../../../../..
Try correcting the name to the name of an existing getter, or defining a getter or field.
        logger?.delayed('  ${yellow.wrap('skipped')} $filePath');
                             ^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/generator.dart:399:4.
 - 'DirectoryGeneratorTarget' is from 'package:mason/src/generator.dart' ('../../../../..
Try correcting the name to the name of an existing getter, or defining a getter or field.
                  ? logger?.delayed('  ${lightBlue.wrap('modified')} $filePath')
                                         ^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/generator.dart:400:4.
 - 'DirectoryGeneratorTarget' is from 'package:mason/src/generator.dart' ('../../../../..
Try correcting the name to the name of an existing getter, or defining a getter or field.
                  : logger?.delayed('  ${green.wrap('created')} $filePath'),
                                         ^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/generator.dart:423:5.
    Logger? logger,
    ^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/hooks.dart:165:5: Er.
    Logger? logger,
    ^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/hooks.dart:185:5: Er.
    Logger? logger,
    ^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/hooks.dart:202:25: E.
  Future<void> compile({Logger? logger}) async {
                        ^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/hooks.dart:250:50: E.
  Future<void> _compile({required HookFile hook, Logger? logger}) async {
                                                 ^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/hooks.dart:280:5: Er.
    Logger? logger,
    ^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/hooks.dart:437:3: Er.
  Logger get logger;
  ^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/hooks.dart:165:5: Er.
    Logger? logger,
    ^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/hooks.dart:185:5: Er.
    Logger? logger,
    ^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/hooks.dart:202:25: E.
  Future<void> compile({Logger? logger}) async {
                        ^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/hooks.dart:221:28: E.
 - 'GeneratorHooks' is from 'package:mason/src/generator.dart' ('../../../../../.pub-cac.
Try correcting the name to the name of an existing getter, or defining a getter or field.
    if (result.exitCode != ExitCode.success.code) {
                           ^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/hooks.dart:250:50: E.
  Future<void> _compile({required HookFile hook, Logger? logger}) async {
                                                 ^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/hooks.dart:264:28: E.
 - 'GeneratorHooks' is from 'package:mason/src/generator.dart' ('../../../../../.pub-cac.
Try correcting the name to the name of an existing getter, or defining a getter or field.
    if (result.exitCode != ExitCode.success.code) {
                           ^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/hooks.dart:280:5: Er.
    Logger? logger,
    ^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/mason_bundle.dart:5:y
import 'package:json_annotation/json_annotation.dart';
       ^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/mason_bundle.dart:4:y
import 'package:archive/archive.dart';
       ^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/mason_bundle.dart:13.
@JsonSerializable()
 ^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/mason_bundle.dart:38.
@JsonSerializable(fieldRename: FieldRename.snake)
                               ^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/mason_bundle.dart:38.
@JsonSerializable(fieldRename: FieldRename.snake)
 ^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/mason_bundle.dart:64.
        utf8.decode(BZip2Decoder().decodeBytes(bytes)),
                    ^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/mason_bundle.dart:12.
 - 'MasonBundle' is from 'package:mason/src/mason_bundle.dart' ('../../../../../.pub-cac.
Try correcting the name to the name of an existing method, or defining a method named 'B.
    return BZip2Encoder().encode(utf8.encode(json.encode(bundle.toJson())));
           ^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/mason_bundle.g.dart:.
        $checkKeys(
        ^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/mason_bundle.g.dart:.
MasonBundledFile _$MasonBundledFileFromJson(Map json) => $checkedCreate(
                                                         ^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/mason_bundle.g.dart:.
        $checkKeys(
        ^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/mason_bundle.g.dart:.
MasonBundle _$MasonBundleFromJson(Map json) => $checkedCreate(
                                               ^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/mason_lock_json.darty
import 'package:json_annotation/json_annotation.dart';
       ^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/mason_lock_json.dart.
@JsonSerializable()
 ^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/mason_lock_json.g.da.
        $checkKeys(
        ^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/mason_lock_json.g.da.
MasonLockJson _$MasonLockJsonFromJson(Map json) => $checkedCreate(
                                                   ^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/mason_yaml.dart:3:8:y
import 'package:json_annotation/json_annotation.dart';
       ^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/mason_yaml.dart:12:2.
@JsonSerializable()
 ^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/mason_yaml.dart:55:2.
@JsonSerializable()
 ^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/mason_yaml.dart:85:2.
@JsonSerializable()
 ^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/mason_yaml.g.dart:13.
        $checkKeys(
        ^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/mason_yaml.g.dart:9:.
MasonYaml _$MasonYamlFromJson(Map json) => $checkedCreate(
                                           ^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/mason_yaml.g.dart:36.
        $checkKeys(
        ^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/mason_yaml.g.dart:32.
BrickLocation _$BrickLocationFromJson(Map json) => $checkedCreate(
                                                   ^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/mason_yaml.g.dart:69.
        $checkKeys(
        ^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/mason-0.1.0-dev.52/lib/src/mason_yaml.g.dart:65.
GitPath _$GitPathFromJson(Map json) => $checkedCreate(
                                       ^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/pub_semver-2.1.4/lib/src/version.dart:8:8: Erroy
import 'package:meta/meta.dart' show sealed;
       ^
../../../../../.pub-cache/hosted/pub.dev/pub_semver-2.1.4/lib/src/version.dart:18:2: Err.
@sealed
 ^^^^^^
../../../../../.pub-cache/hosted/pub.dev/pub_semver-2.1.4/lib/src/version.dart:18:2: Err.
@sealed
 ^
../../../../../.pub-cache/hosted/pub.dev/yaml-3.1.2/lib/src/parser.dart:11:8: Error: Erry
import 'package:string_scanner/string_scanner.dart';
       ^
../../../../../.pub-cache/hosted/pub.dev/yaml-3.1.2/lib/src/parser.dart:63:10: Error: 'S.
    } on StringScannerException catch (error) {
         ^^^^^^^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/yaml-3.1.2/lib/src/scanner.dart:12:8: Error: Ery
import 'package:string_scanner/string_scanner.dart';
       ^
../../../../../.pub-cache/hosted/pub.dev/yaml-3.1.2/lib/src/scanner.dart:108:9: Error: T.
  final SpanScanner _scanner;
        ^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/yaml-3.1.2/lib/src/scanner.dart:905:36: Error: .
  Token _scanVersionDirectiveValue(LineScannerState start) {
                                   ^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/yaml-3.1.2/lib/src/scanner.dart:939:32: Error: .
  Token _scanTagDirectiveValue(LineScannerState start) {
                               ^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/yaml-3.1.2/lib/src/scanner.dart:108:9: Error: '.
  final SpanScanner _scanner;
        ^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/yaml-3.1.2/lib/src/scanner.dart:306:20: Error: .
        _scanner = SpanScanner.eager(source, sourceUrl: sourceUrl);
                   ^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/yaml-3.1.2/lib/src/scanner.dart:905:36: Error: .
  Token _scanVersionDirectiveValue(LineScannerState start) {
                                   ^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/yaml-3.1.2/lib/src/scanner.dart:939:32: Error: .
  Token _scanTagDirectiveValue(LineScannerState start) {
                               ^^^^^^^^^^^^^^^^
Bad state: Generating kernel failed!

Expected Behavior APIs created with dart_frog work correctly after upgrading to dart 2.5.0

enzo-desimone commented 3 months ago

Any news?

alestiago commented 3 months ago

Hi @enzo-desimone , thanks for reaching out. It will probably get a high priority and be resolved soon by the team.

labrom commented 3 months ago

I got the same errors as @lightlitebug with Dart 3.5.0 on ChromeOS after having re-installed Dart Frog CLI.

anil-b2infosoft commented 3 months ago

when you upgrade the flutter you can need also upgrade sdk besause sometimes this type of error is occur i think you need the sdk update and after flutter clean and project restart

Schamppu commented 3 months ago

I'm running to this issue as well. Could we please get support for FVM so we could run Dart Frog projects on different Dart versions that global Flutter install?

jsanoza commented 3 months ago

I'm running to this issue as well. Could we please get support for FVM so we could run Dart Frog projects on different Dart versions that global Flutter install?

You can use FVM to manage Dart versions as well.

Flutter version 3.22.3 is using Dart 3.4.4 You can check here: https://docs.flutter.dev/release/archive

rm -rf ~/.mason-cache && fvm install 3.22.3 && fvm use 3.22.3 --force && fvm dart pub global activate dart_frog_cli

To verify: fvm flutter --version or fvm dart --version

When building: fvm exec dart_frog build

Running on dev: fvm exec dart_frog dev

Make sure to run those commands in your projects root directory.

wolfenrain commented 3 months ago

The problem with the CLI right now is that Mason bricks have hooks with a commited pubspec.lock which has kept an old version of archive and win32 even tho our CLI uses the latest mason version.

Dropping the lock and regenerating it should potentially fix it. Will try and confirm and open a PR for a next release with those changes.

alestiago commented 3 months ago

With the release of dart_frog_cli 1.2.3 I'm no longer able to reproduce the errors.

For those that had troubles, try activating the latest Dart Frog CLI:

dart pub global activate dart_frog_cli 
alestiago commented 3 months ago

I am closing this for now as completed. If anything comes up, don't hesitate on telling