Skip to content
This repository has been archived by the owner on Mar 18, 2021. It is now read-only.

Bad state: NoSuchMethodError: The getter 'length' was called on null. #931

Open
vinnytwice opened this issue Jan 3, 2021 · 5 comments
Open

Comments

@vinnytwice
Copy link

I'm having this error when running aqueduct db generate command but only if an initial migration file exists. In order to make changes to my db I have to delete it and then I can generate one..
What should I check out to troubleshoot it?
Many thanks.
This is the print from console :

vinnytwice@Vinnys-iMac fixit_server % aqueduct db generate
-- Aqueduct CLI Version: 3.3.0+1
-- Aqueduct project version: 3.3.0+1
    Replaying versions: 1...
*** Uncaught error
    Bad state: NoSuchMethodError: The getter 'length' was called on null.
Receiver: null
Tried calling: length
  **** Stacktrace
  * #0      Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
  * #1      _ClassMirror.newInstance (dart:mirrors-patch/mirrors_impl.dart:653:44)
  * #2      Executable.instanceOf (<data:application/dart>:14:813)
  * #3      SchemaBuilderExecutable.execute (<data:application/dart>:13:873)
  * #4      main (<data:application/dart>:9:35)
  * #5      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:297:32)
  * #6      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
  ****

@vinnytwice
Copy link
Author

vinnytwice commented Jan 6, 2021

I tried Dart 2.8 and it worked just partially and only with dependency_overrides: Postgres: 2.2.0 set in pubspec.yamlfile . Now, aqueduct db generatecommand works with this version but I'd still get the RangeError when running aqueduct db upgrade command.. so still pretty useless..
I then tried 2.9 but it seems that this version doesn't allow CLI.. #903
So I finally tried 2.7 and both commands now work properly and without dependency_overrides: Postgres: 2.2.0.
What would be the correct Dart/Aqueduct/PostgreSQL setup to work with higher Dart versions like the latest stable 2.10 ?
Thank you very much.

@ayazemre
Copy link

We need to wait for next release which should arrive soon. In Slack they mentioned about releasing it Q12021 if my memory is not wrong. Try to run it with pub run, it solved my problem temporarily.

@vinnytwice
Copy link
Author

@ayazthemre that would be a version 4?
Apparently to make it work with Dart 2.8 this pubspec.yaml file setup would work.

ubspec.yaml file:

name: mysecurename description: mysecuredescription version: 0.1.0 environment: sdk: ">=2.7.0 <3.0.0" dependencies: aqueduct: ^4.0.0-b1 analyzer: '>=0.32.0 <0.41.0' runtime: ^1.0.0-5 http: ^0.12.0+4 mime: ^0.9.6+3 dev_dependencies: test: ^1.0.0 aqueduct_test: ^2.0.0-b1

Havent tested it yet dough..
What benefits does have aqueduct 4 over 3 ?

@ayazemre
Copy link

@ayazthemre that would be a version 4?
Apparently to make it work with Dart 2.8 this pubspec.yaml file setup would work.

ubspec.yaml file:

name: mysecurename description: mysecuredescription version: 0.1.0 environment: sdk: ">=2.7.0 <3.0.0" dependencies: aqueduct: ^4.0.0-b1 analyzer: '>=0.32.0 <0.41.0' runtime: ^1.0.0-5 http: ^0.12.0+4 mime: ^0.9.6+3 dev_dependencies: test: ^1.0.0 aqueduct_test: ^2.0.0-b1

Havent tested it yet dough..
What benefits does have aqueduct 4 over 3 ?

I don't know the benefits but since it will be latest stable version after breaking dart updates we should not be having any problems out of the box. Current as you can see there is -b after version number which I guess means beta. Even in v4 some people seem to have problems so do not use it for production release.

@vinnytwice
Copy link
Author

Got it. I'll stay on current setup then untill a stable issue-free version 4 gets published.
Cheers

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

No branches or pull requests

2 participants