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

Aqueduct serve command not working #930

Open
ehsan0027 opened this issue Jan 2, 2021 · 5 comments
Open

Aqueduct serve command not working #930

ehsan0027 opened this issue Jan 2, 2021 · 5 comments

Comments

@ehsan0027
Copy link

ehsan0027 commented Jan 2, 2021

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'.

  • 'Map' is from 'dart:core'.
  • 'Symbol' is from 'dart:core'.
    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'.
  • 'Symbol' is from 'dart:core'.
    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.
  • 'Future' is from 'dart:async'.
    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'.
  • 'DeclarationMirror' is from 'dart:mirrors'.
  • 'ClassMirror' is from 'dart:mirrors'.
    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'.
  • 'DeclarationMirror' is from 'dart:mirrors'.
  • 'ClassMirror' is from 'dart:mirrors'.
    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

@yavuztarhan
Copy link

yavuztarhan commented Jan 5, 2021

same issue !
edit :i select bin/main.dart filen and i pressed RUN button on VSCode , it start to serve. localhost works now

@kabagouda
Copy link

kabagouda commented Jan 6, 2021

To solve this problem, debug your aqueduct code in your editor
You can simply do that by running the main function (bin/main.dart) or using this command line dart bin/main.dart

and reload your localhost website, it will work.

Null safety is the cause of this error .
You can learn more here : https://dart.dev/null-safety/unsound-null-safety .
Thanks

@riekusr
Copy link

riekusr commented Jan 15, 2021

@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.

@kabagouda
Copy link

kabagouda commented Jan 16, 2021

@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 .
Solution 👍 : Use this stable version of the dart SDK . [Link SDK of the stable version of 2.10.4.](https://storage.googleapis.com/dart-archive/channels/stable/release/2.10.4/sdk/dartsdk-windows-x64-release.zip.sha256sum)

@SzAttila97
Copy link

@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.

Hello!
Have u found any solution for it yet?

Thanks for your answer!
@krimpenrik

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

5 participants