-
Notifications
You must be signed in to change notification settings - Fork 278
db generate. The getter 'length' was called on null. #862
Comments
Hi, I also have this error when working with Flutter Channel Beta. As a temporary solution, switch to the Flutter Channel Stable. This allows me to use the CLI. |
im also experiencing the same error for validating migration file using |
-- Aqueduct CLI Version: 4.0.0-b1
I am facing the same issue |
I'm on stable channel, and I'm experiencing the same issue/error message as @sorgfal with So even though an initial migration file was created just fine after deleting existing ones, and |
I have had a similar issue. I found that making sure I was on Dart 2.8.3 solved my issue. Newer versions of dart seemed to break this. |
does anybody know when this problem will be solved with current dart sdk? |
same issue, waiting for a solution |
same issue ... -- Aqueduct CLI Version: 4.0.0-b1
|
Any updates on this? |
The only way to solve this problem is downgrade |
This is not an acceptable solution as I am also developing in Flutter for the Mobile-side and because of this issue, each time that I need to run the CLI, I need to downgrade the Dart SDK.... not very convenient. |
If you want multiple versions of dart I would recommend using asdf. As for solution without downgrading you could override the aqueduct dependency:
|
Will try that out, thanks @Reductions! Just curious, what was the core issue/why was the latest version of Dart incompatible? Was it somehow an issue with Isolates or the way the non-initial migrations were validated/generated? |
This should be fixed with this PR To explain the issue, the dart team changed how ClassMirror uses namedArguments, but Executable always passed |
Hi this error happens when i try to execute db generate, with existed migration file.
If i delete first migration, new migration will be generated normally.
MacBook-Pro-MacBook:pinta_server pro$ aqueduct db generate -- Aqueduct CLI Version: 4.0.0-b1 -- Aqueduct project version: 4.0.0-b1 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>:15:813)
#3 SchemaBuilderExecutable.execute (<data:application/dart>:14:873)
#4 main (<data:application/dart>:10:35)
#5 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:297:32)
#6 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
Now my migrations folder look like
migrations/
00000001_initial.migration.dart
00000001_initial.migration.dart
class Migration1 extends Migration {
@override
Future upgrade() async { database.createTable(SchemaTable("stores", [SchemaColumn("id", ManagedPropertyType.integer, isPrimaryKey: true, autoincrement: true, isIndexed: false, isNullable: false, isUnique: false),SchemaColumn("title", ManagedPropertyType.string, isPrimaryKey: false, autoincrement: false, isIndexed: false, isNullable: false, isUnique: false)])); }
@override Future downgrade() async {}
@override Future seed() async {}
}
The text was updated successfully, but these errors were encountered: