-
Notifications
You must be signed in to change notification settings - Fork 278
Aqueduct serve command not working #930
Comments
same issue ! |
To solve this problem, debug your aqueduct code in your editor and reload your localhost website, it will work. Null safety is the cause of this error . |
@kagouda your solutions works in running the server, but aqueduct db generate commands also don't work. I know it has to do with the nullsafety but is there any work around? I was using aqueduct without problems, but then had to reinstall flutter and dart and now i can't proberly use aqueduct. |
@krimpenrik Return to the stable version of dart, especially version 2.10.4. Do not use the beta version especially the version 2.12 because it contains null safety . |
Hello! Thanks for your answer! |
Aqueduct CLI Version: 3.3.0+1
-- Aqueduct project version: 3.3.0+1
-- Preparing...
data:application/dart;charset=utf-8,import%20'dart%3Aasync'%3B%0Aimport%20'dart%3Aisolate'%3B%0Aimport%20'dart%3Amirrors'%3B%0Aimport%20'package%3Aaqueduct%2Faqueduct.dart'%3B%0Aimport%20'package%3Aheroes%2Fheroes.dart'%3B%0AFuture%20main%20(List%3CString%3E%20args%2C%20Map%3CString%2C%20dynamic%3E%20message)%20async%20%7B%0A%20%20final%20sendPort%20%3D%20message%5B'sendPort'%5D%3B%0A%20%20final%20executable%20%3D%20new%20GetChannelExecutable(message)%3B%0A%20%20final%20result%20%3D%20await%20executable.execute()%3B%0A%20%20sendPort.send(%7B%22_result%22%3A%20result%7D)%3B%0A%7D%0A%20%20%20%20%0Aclass%20GetChannelExecutable%20extends%20Executable%3CString%3E%20%7BGetChannelExecutable(Map%3CString%2C%20dynamic%3E%20message)%20%3A%20super(message)%3B%20%40override%20Future%3CString%3E%20execute()%20async%20%7Bvar%20channelType%20%3D%20ApplicationChannel.defaultType%3B%20if%20(channelType%20%3D%3D%20null)%20%7Breturn%20null%3B%7D%20return%20MirrorSystem.getName(reflectClass(channelType).simpleName)%3B%7D%20static%20List%3CString%3E%20importsForPackage(String%20packageName)%20%3D%3E%20%5B%22package%3Aaqueduct%2Faqueduct.dart%22%2C%20%22package%3A%24packageName%2F%24packageName.dart%22%5D%3B%7D%0Aabstract%20class%20Executable%3CT%3E%20%7BExecutable(this.message)%20%3A%20_sendPort%20%3D%20message%5B%22_sendPort%22%5D%3B%20Future%3CT%3E%20execute()%3B%20final%20Map%3CString%2C%20dynamic%3E%20message%3B%20final%20SendPort%20_sendPort%3B%20U%20instanceOf%3CU%3E(String%20typeName%2C%20%7BList%20positionalArguments%3A%20const%20%5B%5D%2C%20Map%3CSymbol%2C%20dynamic%3E%20namedArguments%2C%20Symbol%20constructorName%7D)%20%7BClassMirror%20typeMirror%20%3D%20currentMirrorSystem().isolate.rootLibrary.declarations%5Bnew%20Symbol(typeName)%5D%3B%20if%20(typeMirror%20%3D%3D%20null)%20%7BtypeMirror%20%3D%20currentMirrorSystem().libraries.values.where((lib)%20%3D%3E%20lib.uri.scheme%20%3D%3D%20%22package%22%20%7C%7C%20lib.uri.scheme%20%3D%3D%20%22file%22).expand((lib)%20%3D%3E%20lib.declarations.values).firstWhere((decl)%20%3D%3E%20decl%20is%20ClassMirror%20%26%26%20MirrorSystem.getName(decl.simpleName)%20%3D%3D%20typeName%2C%20orElse%3A%20()%20%3D%3E%20throw%20new%20ArgumentError(%22Unknown%20type%20'%24typeName'.%20Did%20you%20forget%20to%20import%20it%3F%22))%3B%7D%20return%20typeMirror.newInstance(constructorName%20%3F%3F%20const%20Symbol(%22%22)%2C%20positionalArguments%2C%20namedArguments).reflectee%20as%20U%3B%7D%20void%20send(dynamic%20message)%20%7B_sendPort.send(message)%3B%7D%20void%20log(String%20message)%20%7B_sendPort.send(%7B%22_line%22%20%3A%20message%7D)%3B%7D%7D%0A:14:825: Warning: Operand of null-aware operation '??' has type 'Symbol' which excludes null.
'Symbol' is from 'dart:core'.
abstract class Executable {Executable(this.message) : _sendPort = message["_sendPort"]; Future execute(); final Map<String, dynamic> message; final SendPort _sendPort; U instanceOf(String typeName, {List positionalArguments: const [], Map<Symbol, dynamic> namedArguments, Symbol constructorName}) {ClassMirror typeMirror = currentMirrorSystem().isolate.rootLibrary.declarations[new Symbol(typeName)]; if (typeMirror == null) {typeMirror = currentMirrorSystem().libraries.values.where((lib) => lib.uri.scheme == "package" || lib.uri.scheme == "file").expand((lib) => lib.declarations.values).firstWhere((decl) => decl is ClassMirror && MirrorSystem.getName(decl.simpleName) == typeName, orElse: () => throw new ArgumentError("Unknown type '$typeName'. Did you forget to import it?"));} return typeMirror.newInstance(constructorName ?? const Symbol(""), positionalArguments, namedArguments).reflectee as U;} void send(dynamic message) {_sendPort.send(message);} void log(String message) {_sendPort.send({"line" : message});}}
^
*** Uncaught error
IsolateSpawnException: Unable to spawn isolate: Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:
package:aqueduct
package:heroes
package:logging
package:safe_config
package:crypto
package:password_hash
package:open_api
package:yaml
package:postgres
package:meta
package:path
package:collection
package:convert
package:codable
package:charcode
package:source_span
package:typed_data
package:string_scanner
package:term_glyph
data:application/dart;charset=utf-8,import%20'dart%3Aasync'%3B%0Aimport%20'dart%3Aisolate'%3B%0Aimport%20'dart%3Amirrors'%3B%0Aimport%20'package%3Aaqueduct%2Faqueduct.dart'%3B%0Aimport%20'package%3Aheroes%2Fheroes.dart'%3B%0AFuture%20main%20(List%3CString%3E%20args%2C%20Map%3CString%2C%20dynamic%3E%20message)%20async%20%7B%0A%20%20final%20sendPort%20%3D%20message%5B'sendPort'%5D%3B%0A%20%20final%20executable%20%3D%20new%20GetChannelExecutable(message)%3B%0A%20%20final%20result%20%3D%20await%20executable.execute()%3B%0A%20%20sendPort.send(%7B%22_result%22%3A%20result%7D)%3B%0A%7D%0A%20%20%20%20%0Aclass%20GetChannelExecutable%20extends%20Executable%3CString%3E%20%7BGetChannelExecutable(Map%3CString%2C%20dynamic%3E%20message)%20%3A%20super(message)%3B%20%40override%20Future%3CString%3E%20execute()%20async%20%7Bvar%20channelType%20%3D%20ApplicationChannel.defaultType%3B%20if%20(channelType%20%3D%3D%20null)%20%7Breturn%20null%3B%7D%20return%20MirrorSystem.getName(reflectClass(channelType).simpleName)%3B%7D%20static%20List%3CString%3E%20importsForPackage(String%20packageName)%20%3D%3E%20%5B%22package%3Aaqueduct%2Faqueduct.dart%22%2C%20%22package%3A%24packageName%2F%24packageName.dart%22%5D%3B%7D%0Aabstract%20class%20Executable%3CT%3E%20%7BExecutable(this.message)%20%3A%20_sendPort%20%3D%20message%5B%22_sendPort%22%5D%3B%20Future%3CT%3E%20execute()%3B%20final%20Map%3CString%2C%20dynamic%3E%20message%3B%20final%20SendPort%20_sendPort%3B%20U%20instanceOf%3CU%3E(String%20typeName%2C%20%7BList%20positionalArguments%3A%20const%20%5B%5D%2C%20Map%3CSymbol%2C%20dynamic%3E%20namedArguments%2C%20Symbol%20constructorName%7D)%20%7BClassMirror%20typeMirror%20%3D%20currentMirrorSystem().isolate.rootLibrary.declarations%5Bnew%20Symbol(typeName)%5D%3B%20if%20(typeMirror%20%3D%3D%20null)%20%7BtypeMirror%20%3D%20currentMirrorSystem().libraries.values.where((lib)%20%3D%3E%20lib.uri.scheme%20%3D%3D%20%22package%22%20%7C%7C%20lib.uri.scheme%20%3D%3D%20%22file%22).expand((lib)%20%3D%3E%20lib.declarations.values).firstWhere((decl)%20%3D%3E%20decl%20is%20ClassMirror%20%26%26%20MirrorSystem.getName(decl.simpleName)%20%3D%3D%20typeName%2C%20orElse%3A%20()%20%3D%3E%20throw%20new%20ArgumentError(%22Unknown%20type%20'%24typeName'.%20Did%20you%20forget%20to%20import%20it%3F%22))%3B%7D%20return%20typeMirror.newInstance(constructorName%20%3F%3F%20const%20Symbol(%22%22)%2C%20positionalArguments%2C%20namedArguments).reflectee%20as%20U%3B%7D%20void%20send(dynamic%20message)%20%7B_sendPort.send(message)%3B%7D%20void%20log(String%20message)%20%7B_sendPort.send(%7B%22_line%22%20%3A%20message%7D)%3B%7D%7D%0A:14:266: Error: The parameter 'namedArguments' can't have a value of 'null' because of its type 'Map<Symbol, dynamic>', but the implicit default value is 'null'.
Try adding either an explicit non-'null' default value or the 'required' modifier.
abstract class Executable {Executable(this.message) : _sendPort = message["_sendPort"]; Future execute(); final Map<String, dynamic> message; final SendPort _sendPort; U instanceOf(String typeName, {List positionalArguments: const [], Map<Symbol, dynamic> namedArguments, Symbol constructorName}) {ClassMirror typeMirror = currentMirrorSystem().isolate.rootLibrary.declarations[new Symbol(typeName)]; if (typeMirror == null) {typeMirror = currentMirrorSystem().libraries.values.where((lib) => lib.uri.scheme == "package" || lib.uri.scheme == "file").expand((lib) => lib.declarations.values).firstWhere((decl) => decl is ClassMirror && MirrorSystem.getName(decl.simpleName) == typeName, orElse: () => throw new ArgumentError("Unknown type '$typeName'. Did you forget to import it?"));} return typeMirror.newInstance(constructorName ?? const Symbol(""), positionalArguments, namedArguments).reflectee as U;} void send(dynamic message) {_sendPort.send(message);} void log(String message) {_sendPort.send({"line" : message});}}
^^^^^^^^^^^^^^
data:application/dart;charset=utf-8,import%20'dart%3Aasync'%3B%0Aimport%20'dart%3Aisolate'%3B%0Aimport%20'dart%3Amirrors'%3B%0Aimport%20'package%3Aaqueduct%2Faqueduct.dart'%3B%0Aimport%20'package%3Aheroes%2Fheroes.dart'%3B%0AFuture%20main%20(List%3CString%3E%20args%2C%20Map%3CString%2C%20dynamic%3E%20message)%20async%20%7B%0A%20%20final%20sendPort%20%3D%20message%5B'sendPort'%5D%3B%0A%20%20final%20executable%20%3D%20new%20GetChannelExecutable(message)%3B%0A%20%20final%20result%20%3D%20await%20executable.execute()%3B%0A%20%20sendPort.send(%7B%22_result%22%3A%20result%7D)%3B%0A%7D%0A%20%20%20%20%0Aclass%20GetChannelExecutable%20extends%20Executable%3CString%3E%20%7BGetChannelExecutable(Map%3CString%2C%20dynamic%3E%20message)%20%3A%20super(message)%3B%20%40override%20Future%3CString%3E%20execute()%20async%20%7Bvar%20channelType%20%3D%20ApplicationChannel.defaultType%3B%20if%20(channelType%20%3D%3D%20null)%20%7Breturn%20null%3B%7D%20return%20MirrorSystem.getName(reflectClass(channelType).simpleName)%3B%7D%20static%20List%3CString%3E%20importsForPackage(String%20packageName)%20%3D%3E%20%5B%22package%3Aaqueduct%2Faqueduct.dart%22%2C%20%22package%3A%24packageName%2F%24packageName.dart%22%5D%3B%7D%0Aabstract%20class%20Executable%3CT%3E%20%7BExecutable(this.message)%20%3A%20_sendPort%20%3D%20message%5B%22_sendPort%22%5D%3B%20Future%3CT%3E%20execute()%3B%20final%20Map%3CString%2C%20dynamic%3E%20message%3B%20final%20SendPort%20_sendPort%3B%20U%20instanceOf%3CU%3E(String%20typeName%2C%20%7BList%20positionalArguments%3A%20const%20%5B%5D%2C%20Map%3CSymbol%2C%20dynamic%3E%20namedArguments%2C%20Symbol%20constructorName%7D)%20%7BClassMirror%20typeMirror%20%3D%20currentMirrorSystem().isolate.rootLibrary.declarations%5Bnew%20Symbol(typeName)%5D%3B%20if%20(typeMirror%20%3D%3D%20null)%20%7BtypeMirror%20%3D%20currentMirrorSystem().libraries.values.where((lib)%20%3D%3E%20lib.uri.scheme%20%3D%3D%20%22package%22%20%7C%7C%20lib.uri.scheme%20%3D%3D%20%22file%22).expand((lib)%20%3D%3E%20lib.declarations.values).firstWhere((decl)%20%3D%3E%20decl%20is%20ClassMirror%20%26%26%20MirrorSystem.getName(decl.simpleName)%20%3D%3D%20typeName%2C%20orElse%3A%20()%20%3D%3E%20throw%20new%20ArgumentError(%22Unknown%20type%20'%24typeName'.%20Did%20you%20forget%20to%20import%20it%3F%22))%3B%7D%20return%20typeMirror.newInstance(constructorName%20%3F%3F%20const%20Symbol(%22%22)%2C%20positionalArguments%2C%20namedArguments).reflectee%20as%20U%3B%7D%20void%20send(dynamic%20message)%20%7B_sendPort.send(message)%3B%7D%20void%20log(String%20message)%20%7B_sendPort.send(%7B%22_line%22%20%3A%20message%7D)%3B%7D%7D%0A:14:289: Error: The parameter 'constructorName' can't have a value of 'null' because of its type 'Symbol', but the implicit default value is 'null'.
Try adding either an explicit non-'null' default value or the 'required' modifier.
abstract class Executable {Executable(this.message) : _sendPort = message["_sendPort"]; Future execute(); final Map<String, dynamic> message; final SendPort _sendPort; U instanceOf(String typeName, {List positionalArguments: const [], Map<Symbol, dynamic> namedArguments, Symbol constructorName}) {ClassMirror typeMirror = currentMirrorSystem().isolate.rootLibrary.declarations[new Symbol(typeName)]; if (typeMirror == null) {typeMirror = currentMirrorSystem().libraries.values.where((lib) => lib.uri.scheme == "package" || lib.uri.scheme == "file").expand((lib) => lib.declarations.values).firstWhere((decl) => decl is ClassMirror && MirrorSystem.getName(decl.simpleName) == typeName, orElse: () => throw new ArgumentError("Unknown type '$typeName'. Did you forget to import it?"));} return typeMirror.newInstance(constructorName ?? const Symbol(""), positionalArguments, namedArguments).reflectee as U;} void send(dynamic message) {_sendPort.send(message);} void log(String message) {_sendPort.send({"line" : message});}}
^^^^^^^^^^^^^^^
data:application/dart;charset=utf-8,import%20'dart%3Aasync'%3B%0Aimport%20'dart%3Aisolate'%3B%0Aimport%20'dart%3Amirrors'%3B%0Aimport%20'package%3Aaqueduct%2Faqueduct.dart'%3B%0Aimport%20'package%3Aheroes%2Fheroes.dart'%3B%0AFuture%20main%20(List%3CString%3E%20args%2C%20Map%3CString%2C%20dynamic%3E%20message)%20async%20%7B%0A%20%20final%20sendPort%20%3D%20message%5B'sendPort'%5D%3B%0A%20%20final%20executable%20%3D%20new%20GetChannelExecutable(message)%3B%0A%20%20final%20result%20%3D%20await%20executable.execute()%3B%0A%20%20sendPort.send(%7B%22_result%22%3A%20result%7D)%3B%0A%7D%0A%20%20%20%20%0Aclass%20GetChannelExecutable%20extends%20Executable%3CString%3E%20%7BGetChannelExecutable(Map%3CString%2C%20dynamic%3E%20message)%20%3A%20super(message)%3B%20%40override%20Future%3CString%3E%20execute()%20async%20%7Bvar%20channelType%20%3D%20ApplicationChannel.defaultType%3B%20if%20(channelType%20%3D%3D%20null)%20%7Breturn%20null%3B%7D%20return%20MirrorSystem.getName(reflectClass(channelType).simpleName)%3B%7D%20static%20List%3CString%3E%20importsForPackage(String%20packageName)%20%3D%3E%20%5B%22package%3Aaqueduct%2Faqueduct.dart%22%2C%20%22package%3A%24packageName%2F%24packageName.dart%22%5D%3B%7D%0Aabstract%20class%20Executable%3CT%3E%20%7BExecutable(this.message)%20%3A%20_sendPort%20%3D%20message%5B%22_sendPort%22%5D%3B%20Future%3CT%3E%20execute()%3B%20final%20Map%3CString%2C%20dynamic%3E%20message%3B%20final%20SendPort%20_sendPort%3B%20U%20instanceOf%3CU%3E(String%20typeName%2C%20%7BList%20positionalArguments%3A%20const%20%5B%5D%2C%20Map%3CSymbol%2C%20dynamic%3E%20namedArguments%2C%20Symbol%20constructorName%7D)%20%7BClassMirror%20typeMirror%20%3D%20currentMirrorSystem().isolate.rootLibrary.declarations%5Bnew%20Symbol(typeName)%5D%3B%20if%20(typeMirror%20%3D%3D%20null)%20%7BtypeMirror%20%3D%20currentMirrorSystem().libraries.values.where((lib)%20%3D%3E%20lib.uri.scheme%20%3D%3D%20%22package%22%20%7C%7C%20lib.uri.scheme%20%3D%3D%20%22file%22).expand((lib)%20%3D%3E%20lib.declarations.values).firstWhere((decl)%20%3D%3E%20decl%20is%20ClassMirror%20%26%26%20MirrorSystem.getName(decl.simpleName)%20%3D%3D%20typeName%2C%20orElse%3A%20()%20%3D%3E%20throw%20new%20ArgumentError(%22Unknown%20type%20'%24typeName'.%20Did%20you%20forget%20to%20import%20it%3F%22))%3B%7D%20return%20typeMirror.newInstance(constructorName%20%3F%3F%20const%20Symbol(%22%22)%2C%20positionalArguments%2C%20namedArguments).reflectee%20as%20U%3B%7D%20void%20send(dynamic%20message)%20%7B_sendPort.send(message)%3B%7D%20void%20log(String%20message)%20%7B_sendPort.send(%7B%22_line%22%20%3A%20message%7D)%3B%7D%7D%0A:13:250: Error: The value 'null' can't be returned from an async function with return type 'Future' because 'Future' is not nullable.
class GetChannelExecutable extends Executable {GetChannelExecutable(Map<String, dynamic> message) : super(message); @OverRide Future execute() async {var channelType = ApplicationChannel.defaultType; if (channelType == null) {return null;} return MirrorSystem.getName(reflectClass(channelType).simpleName);} static List importsForPackage(String packageName) => ["package:aqueduct/aqueduct.dart", "package:$packageName/$packageName.dart"];}
^
data:application/dart;charset=utf-8,import%20'dart%3Aasync'%3B%0Aimport%20'dart%3Aisolate'%3B%0Aimport%20'dart%3Amirrors'%3B%0Aimport%20'package%3Aaqueduct%2Faqueduct.dart'%3B%0Aimport%20'package%3Aheroes%2Fheroes.dart'%3B%0AFuture%20main%20(List%3CString%3E%20args%2C%20Map%3CString%2C%20dynamic%3E%20message)%20async%20%7B%0A%20%20final%20sendPort%20%3D%20message%5B'sendPort'%5D%3B%0A%20%20final%20executable%20%3D%20new%20GetChannelExecutable(message)%3B%0A%20%20final%20result%20%3D%20await%20executable.execute()%3B%0A%20%20sendPort.send(%7B%22_result%22%3A%20result%7D)%3B%0A%7D%0A%20%20%20%20%0Aclass%20GetChannelExecutable%20extends%20Executable%3CString%3E%20%7BGetChannelExecutable(Map%3CString%2C%20dynamic%3E%20message)%20%3A%20super(message)%3B%20%40override%20Future%3CString%3E%20execute()%20async%20%7Bvar%20channelType%20%3D%20ApplicationChannel.defaultType%3B%20if%20(channelType%20%3D%3D%20null)%20%7Breturn%20null%3B%7D%20return%20MirrorSystem.getName(reflectClass(channelType).simpleName)%3B%7D%20static%20List%3CString%3E%20importsForPackage(String%20packageName)%20%3D%3E%20%5B%22package%3Aaqueduct%2Faqueduct.dart%22%2C%20%22package%3A%24packageName%2F%24packageName.dart%22%5D%3B%7D%0Aabstract%20class%20Executable%3CT%3E%20%7BExecutable(this.message)%20%3A%20_sendPort%20%3D%20message%5B%22_sendPort%22%5D%3B%20Future%3CT%3E%20execute()%3B%20final%20Map%3CString%2C%20dynamic%3E%20message%3B%20final%20SendPort%20_sendPort%3B%20U%20instanceOf%3CU%3E(String%20typeName%2C%20%7BList%20positionalArguments%3A%20const%20%5B%5D%2C%20Map%3CSymbol%2C%20dynamic%3E%20namedArguments%2C%20Symbol%20constructorName%7D)%20%7BClassMirror%20typeMirror%20%3D%20currentMirrorSystem().isolate.rootLibrary.declarations%5Bnew%20Symbol(typeName)%5D%3B%20if%20(typeMirror%20%3D%3D%20null)%20%7BtypeMirror%20%3D%20currentMirrorSystem().libraries.values.where((lib)%20%3D%3E%20lib.uri.scheme%20%3D%3D%20%22package%22%20%7C%7C%20lib.uri.scheme%20%3D%3D%20%22file%22).expand((lib)%20%3D%3E%20lib.declarations.values).firstWhere((decl)%20%3D%3E%20decl%20is%20ClassMirror%20%26%26%20MirrorSystem.getName(decl.simpleName)%20%3D%3D%20typeName%2C%20orElse%3A%20()%20%3D%3E%20throw%20new%20ArgumentError(%22Unknown%20type%20'%24typeName'.%20Did%20you%20forget%20to%20import%20it%3F%22))%3B%7D%20return%20typeMirror.newInstance(constructorName%20%3F%3F%20const%20Symbol(%22%22)%2C%20positionalArguments%2C%20namedArguments).reflectee%20as%20U%3B%7D%20void%20send(dynamic%20message)%20%7B_sendPort.send(message)%3B%7D%20void%20log(String%20message)%20%7B_sendPort.send(%7B%22_line%22%20%3A%20message%7D)%3B%7D%7D%0A:14:387: Error: A value of type 'DeclarationMirror?' can't be assigned to a variable of type 'ClassMirror'.
abstract class Executable {Executable(this.message) : _sendPort = message["_sendPort"]; Future execute(); final Map<String, dynamic> message; final SendPort _sendPort; U instanceOf(String typeName, {List positionalArguments: const [], Map<Symbol, dynamic> namedArguments, Symbol constructorName}) {ClassMirror typeMirror = currentMirrorSystem().isolate.rootLibrary.declarations[new Symbol(typeName)]; if (typeMirror == null) {typeMirror = currentMirrorSystem().libraries.values.where((lib) => lib.uri.scheme == "package" || lib.uri.scheme == "file").expand((lib) => lib.declarations.values).firstWhere((decl) => decl is ClassMirror && MirrorSystem.getName(decl.simpleName) == typeName, orElse: () => throw new ArgumentError("Unknown type '$typeName'. Did you forget to import it?"));} return typeMirror.newInstance(constructorName ?? const Symbol(""), positionalArguments, namedArguments).reflectee as U;} void send(dynamic message) {_sendPort.send(message);} void log(String message) {_sendPort.send({"line" : message});}}
^
data:application/dart;charset=utf-8,import%20'dart%3Aasync'%3B%0Aimport%20'dart%3Aisolate'%3B%0Aimport%20'dart%3Amirrors'%3B%0Aimport%20'package%3Aaqueduct%2Faqueduct.dart'%3B%0Aimport%20'package%3Aheroes%2Fheroes.dart'%3B%0AFuture%20main%20(List%3CString%3E%20args%2C%20Map%3CString%2C%20dynamic%3E%20message)%20async%20%7B%0A%20%20final%20sendPort%20%3D%20message%5B'sendPort'%5D%3B%0A%20%20final%20executable%20%3D%20new%20GetChannelExecutable(message)%3B%0A%20%20final%20result%20%3D%20await%20executable.execute()%3B%0A%20%20sendPort.send(%7B%22_result%22%3A%20result%7D)%3B%0A%7D%0A%20%20%20%20%0Aclass%20GetChannelExecutable%20extends%20Executable%3CString%3E%20%7BGetChannelExecutable(Map%3CString%2C%20dynamic%3E%20message)%20%3A%20super(message)%3B%20%40override%20Future%3CString%3E%20execute()%20async%20%7Bvar%20channelType%20%3D%20ApplicationChannel.defaultType%3B%20if%20(channelType%20%3D%3D%20null)%20%7Breturn%20null%3B%7D%20return%20MirrorSystem.getName(reflectClass(channelType).simpleName)%3B%7D%20static%20List%3CString%3E%20importsForPackage(String%20packageName)%20%3D%3E%20%5B%22package%3Aaqueduct%2Faqueduct.dart%22%2C%20%22package%3A%24packageName%2F%24packageName.dart%22%5D%3B%7D%0Aabstract%20class%20Executable%3CT%3E%20%7BExecutable(this.message)%20%3A%20_sendPort%20%3D%20message%5B%22_sendPort%22%5D%3B%20Future%3CT%3E%20execute()%3B%20final%20Map%3CString%2C%20dynamic%3E%20message%3B%20final%20SendPort%20_sendPort%3B%20U%20instanceOf%3CU%3E(String%20typeName%2C%20%7BList%20positionalArguments%3A%20const%20%5B%5D%2C%20Map%3CSymbol%2C%20dynamic%3E%20namedArguments%2C%20Symbol%20constructorName%7D)%20%7BClassMirror%20typeMirror%20%3D%20currentMirrorSystem().isolate.rootLibrary.declarations%5Bnew%20Symbol(typeName)%5D%3B%20if%20(typeMirror%20%3D%3D%20null)%20%7BtypeMirror%20%3D%20currentMirrorSystem().libraries.values.where((lib)%20%3D%3E%20lib.uri.scheme%20%3D%3D%20%22package%22%20%7C%7C%20lib.uri.scheme%20%3D%3D%20%22file%22).expand((lib)%20%3D%3E%20lib.declarations.values).firstWhere((decl)%20%3D%3E%20decl%20is%20ClassMirror%20%26%26%20MirrorSystem.getName(decl.simpleName)%20%3D%3D%20typeName%2C%20orElse%3A%20()%20%3D%3E%20throw%20new%20ArgumentError(%22Unknown%20type%20'%24typeName'.%20Did%20you%20forget%20to%20import%20it%3F%22))%3B%7D%20return%20typeMirror.newInstance(constructorName%20%3F%3F%20const%20Symbol(%22%22)%2C%20positionalArguments%2C%20namedArguments).reflectee%20as%20U%3B%7D%20void%20send(dynamic%20message)%20%7B_sendPort.send(message)%3B%7D%20void%20log(String%20message)%20%7B_sendPort.send(%7B%22_line%22%20%3A%20message%7D)%3B%7D%7D%0A:14:601: Error: A value of type 'DeclarationMirror' can't be assigned to a variable of type 'ClassMirror'.
abstract class Executable {Executable(this.message) : _sendPort = message["_sendPort"]; Future execute(); final Map<String, dynamic> message; final SendPort _sendPort; U instanceOf(String typeName, {List positionalArguments: const [], Map<Symbol, dynamic> namedArguments, Symbol constructorName}) {ClassMirror typeMirror = currentMirrorSystem().isolate.rootLibrary.declarations[new Symbol(typeName)]; if (typeMirror == null) {typeMirror = currentMirrorSystem().libraries.values.where((lib) => lib.uri.scheme == "package" || lib.uri.scheme == "file").expand((lib) => lib.declarations.values).firstWhere((decl) => decl is ClassMirror && MirrorSystem.getName(decl.simpleName) == typeName, orElse: () => throw new ArgumentError("Unknown type '$typeName'. Did you forget to import it?"));} return typeMirror.newInstance(constructorName ?? const Symbol(""), positionalArguments, namedArguments).reflectee as U;} void send(dynamic message) {_sendPort.send(message);} void log(String message) {_sendPort.send({"line" : message});}}
^
**** Stacktrace
The text was updated successfully, but these errors were encountered: