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

"liquidart create newapp" Unhandled exception: Bad state: No element #5

Open
EvErTrEk opened this issue Apr 20, 2021 · 7 comments
Open
Assignees
Labels
bug Something isn't working critical Very important issues critical to the package's functionality help wanted Extra attention is needed

Comments

@EvErTrEk
Copy link

EvErTrEk commented Apr 20, 2021

Unhandled exception:
Bad state: No element
#0 ListMixin.firstWhere (dart:collection/list.dart:167:5)
#1 firstMetadataOfType (package:replica/src/mirror_context.dart:70:23)
#2 new MirrorContext._. (package:replica/src/mirror_context.dart:31:22)
#3 WhereIterator.moveNext (dart:_internal/iterable.dart:436:13)
#4 new _GrowableList.ofOther (dart:core-patch/growable_array.dart:198:26)
#5 new GrowableList.of (dart:core-patch/growable_array.dart:152:26)
#6 new List.of (dart:core-patch/array_patch.dart:50:28)
#7 Iterable.toList (dart:core/iterable.dart:366:12)
#8 new MirrorContext. (package:replica/src/mirror_context.dart:32:8)
#9 instance (package:replica/src/mirror_context.dart:7:41)
#10 instance (package:replica/src/mirror_context.dart)
#11 RuntimeContext.current (package:replica/src/context.dart:10:33)
#12 CLICommand.decode (package:liquidart/src/cli/command.dart:104:27)
#13 CLICommand.showColors (package:liquidart/src/cli/command.dart:64:26)
#14 CLICommand.colorSymbol (package:liquidart/src/cli/command.dart:219:10)
#15 CLICommand.displayError (package:liquidart/src/cli/command.dart:201:12)
#16 CLICommand.process (package:liquidart/src/cli/command.dart:168:7)

#17 main (file:///C:/Users/Everton/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/liquidart-5.0.0-b4/bin/liquidart.dart:9:14)
Unhandled exception:
Bad state: No element
#0 ListMixin.firstWhere (dart:collection/list.dart:167:5)
#1 firstMetadataOfType (package:replica/src/mirror_context.dart:70:23)
#2 new MirrorContext.. (package:replica/src/mirror_context.dart:31:22)
#3 WhereIterator.moveNext (dart:_internal/iterable.dart:436:13)
#4 new _GrowableList._ofOther (dart:core-patch/growable_array.dart:198:26)
#5 new GrowableList.of (dart:core-patch/growable_array.dart:152:26)
#6 new List.of (dart:core-patch/array_patch.dart:50:28)
#7 Iterable.toList (dart:core/iterable.dart:366:12)
#8 new MirrorContext. (package:replica/src/mirror_context.dart:32:8)
#9 instance (package:replica/src/mirror_context.dart:7:41)
#10 instance (package:replica/src/mirror_context.dart)
#11 RuntimeContext.current (package:replica/src/context.dart:10:33)
#12 CLICommand.decode (package:liquidart/src/cli/command.dart:104:27)
#13 CLICommand.showColors (package:liquidart/src/cli/command.dart:64:26)
#14 CLICommand.colorSymbol (package:liquidart/src/cli/command.dart:219:10)
#15 CLICommand.displayError (package:liquidart/src/cli/command.dart:201:12)
#16 CLICommand.process (package:liquidart/src/cli/command.dart:168:7)

#17 main (file:///C:/Users/Everton/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/liquidart-5.0.0-b4/bin/liquidart.dart:9:14)

Dart SDK version: 2.12.3 (stable) (Wed Apr 14 11:02:39 2021 +0200) on "windows_x64"

@EvErTrEk EvErTrEk changed the title Unhandled exception: Bad state: No element "liquidart create newapp" Unhandled exception: Bad state: No element Apr 21, 2021
@AldrinMathew AldrinMathew self-assigned this Apr 21, 2021
@AldrinMathew AldrinMathew added bug Something isn't working critical Very important issues critical to the package's functionality help wanted Extra attention is needed labels Apr 21, 2021
@AldrinMathew
Copy link
Owner

@EvErTrEk

This is part of the error caused by the migration to Null Safety of the package. I have been trying to fix this for a day, so far, there is no good news. Leave this issue open. I will post updates related to the issue here.

@AldrinMathew AldrinMathew pinned this issue Apr 21, 2021
@AldrinMathew
Copy link
Owner

I just found out that this issue pertains to the Dart language, and has been reported in the Dart project previously.

dm.metadata
      .firstWhere((im) => im!.reflectee is Operation, orElse: () => null)!
      .reflectee as Operation;

The orElse part of the code is what's causing the error. We have to replace that part with a conditional statement. There are more than 150 parts in the Liquidart project where this pattern of code occurs. I have already started fixing it.

@AldrinMathew AldrinMathew unpinned this issue Apr 22, 2021
@AldrinMathew
Copy link
Owner

@EvErTrEk

Please read Issue 7: Liquidart will be rewritten from scratch to understand the status of this issue and the Liquidart project.

@EvErTrEk
Copy link
Author

Tanks :)

@EddieKamau
Copy link

I had forked Aqueduct for customization, after learning about Liquidart I changed some Aqueduct packages to those of Liquidart.
The packages include safe_yaml from safe_config, replica from runtime, hasher from password_hash, and loner from isolate_executor.
Then I migrated to Null safety & fixed the errors. Now it runs smoothly.
The only difference is ownerId(resourceOwnerId... etc) is changed from int to String(for self needs).
You can checkout the repo at Aqueduct

@AldrinMathew
Copy link
Owner

AldrinMathew commented May 19, 2021

@EddieKamau do you mind making a PR to this repo's dev branch from your fork once it is completed? Also, I have sent an email regarding this. Kindly check when you have time.

@EddieKamau
Copy link

EddieKamau commented May 19, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working critical Very important issues critical to the package's functionality help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants