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

Compile error Hooked service #249

Closed
massimoliani opened this issue Nov 5, 2019 · 8 comments

Comments

@massimoliani
Copy link

@massimoliani massimoliani commented Nov 5, 2019

I'm getting a startup error as the attached error message:

/C:/Users/massi/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/angel_framework-2.0.4+1/lib/src/core/hooked_service.dart:102:27: Error: The argument type 'List<FutureOr Function(HookedServiceEvent<dynamic, dynamic, Service<Null, Null>>)>' can't be assigned to the parameter type 'Iterable<FutureOr Function(HookedServiceEvent<Id, Data, T>)>'.

  • 'List' is from 'dart:core'.
  • 'FutureOr' is from 'dart:async'.
  • 'HookedServiceEvent' is from 'package:angel_framework/src/core/hooked_service.dart' ('/C:/Users/massi/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/angel_framework-2.0.4+1/lib/src/core/hooked_service.dart').
  • 'Service' is from 'package:angel_framework/src/core/service.dart' ('/C:/Users/massi/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/angel_framework-2.0.4+1/lib/src/core/service.dart').
  • 'Iterable' is from 'dart:core'.
    before.addAll(hooks.before);

/C:/Users/massi/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/angel_framework-2.0.4+1/lib/src/core/hooked_service.dart:103:26: Error: The argument type 'List<FutureOr Function(HookedServiceEvent<dynamic, dynamic, Service<Null, Null>>)>' can't be assigned to the parameter type 'Iterable<FutureOr Function(HookedServiceEvent<Id, Data, T>)>'.

  • 'List' is from 'dart:core'.
  • 'FutureOr' is from 'dart:async'.
  • 'HookedServiceEvent' is from 'package:angel_framework/src/core/hooked_service.dart' ('/C:/Users/massi/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/angel_framework-2.0.4+1/lib/src/core/hooked_service.dart').
  • 'Service' is from 'package:angel_framework/src/core/service.dart' ('/C:/Users/massi/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/angel_framework-2.0.4+1/lib/src/core/service.dart').
  • 'Iterable' is from 'dart:core'.
    after.addAll(hooks.after);
    ^
    /C:/Users/massi/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/angel_framework-2.0.4+1/lib/src/core/hooked_service.dart:114:42: Error: The argument type 'List<FutureOr Function(HookedServiceEvent<dynamic, dynamic, Service<Null, Null>>)>' can't be assigned to the parameter type 'Iterable<FutureOr Function(HookedServiceEvent<Id, Data, T>)>'.
  • 'List' is from 'dart:core'.
  • 'FutureOr' is from 'dart:async'.
  • 'HookedServiceEvent' is from 'package:angel_framework/src/core/hooked_service.dart' ('/C:/Users/massi/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/angel_framework-2.0.4+1/lib/src/core/hooked_service.dart').
  • 'Service' is from 'package:angel_framework/src/core/service.dart' ('/C:/Users/massi/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/angel_framework-2.0.4+1/lib/src/core/service.dart').
  • 'Iterable' is from 'dart:core'.
    listeners.addAll(isAfter == true ? hooks.after : hooks.before);

I just repair cache and do an upgrade of flutter package and pub upgrade.
The application is a backend web server running in a VM.

The problem happen with DART SDK 2.7.0, 2.5.0 and 2.3.0 not happen.

I fould the flutter masterchannel introduce this error.
If you want to reproduce the error use flutter master channel and upgrade.

I switch back to dev channel and everything is working.

@fleugzeug

This comment has been minimized.

Copy link

@fleugzeug fleugzeug commented Nov 12, 2019

Not work with flutter channel master

@thosakwe

This comment has been minimized.

Copy link
Member

@thosakwe thosakwe commented Nov 12, 2019

@massimoliani

This comment has been minimized.

Copy link
Author

@massimoliani massimoliani commented Nov 12, 2019

I start with dart downloading flutter web framework, but never used flutter only dart.
On last update of master channel the DART version was 2.7.0 and I have the problem.
On current version (as flutter doctor):
[√] Flutter (Channel dev, v1.10.14, on Microsoft Windows [Versione 10.0.18362.449], locale it-IT)
• Flutter version 1.10.14 at k:\tools\flutter
• Framework revision 1946fc4da0 (5 weeks ago), 2019-10-07 15:23:31 -0700
• Engine revision 1d62160fdb
• Dart version 2.6.0 (build 2.6.0-dev.5.0 d6c6d12ebf)

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at K:\tools\androidsdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• ANDROID_HOME = K:\tools\androidsdk
• Java binary at: K:\tools\android\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

[√] Chrome - develop for the web
• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Android Studio (version 3.5)
• Android Studio at K:\tools\android
• Flutter plugin version 40.2.2
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

[√] Connected device (2 available)
• Chrome • chrome • web-javascript • Google Chrome 78.0.3904.97
• Headless Server • headless-server • web-javascript • Flutter Tools

! Doctor found issues in 1 category.

Channel dev.

The VM version is: Dart VM version: 2.6.0-dev.5.0.flutter-d6c6d12ebf (Fri Oct 4 10:11:30 2019 +0000) on "windows_x64"

The not working version is (as flutter doctor):
[√] Flutter (Channel master, v1.10.17-pre.59, on Microsoft Windows [Versione 10.0.18362.449], locale it-IT)
• Flutter version 1.10.17-pre.59 at k:\tools\flutter
• Framework revision 9e0df259df (10 hours ago), 2019-11-11 15:56:43 -0800
• Engine revision 31cd2dfca2
• Dart version 2.7.0

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at K:\tools\androidsdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• ANDROID_HOME = K:\tools\androidsdk
• Java binary at: K:\tools\android\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

[√] Chrome - develop for the web
• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[X] Visual Studio - develop for Windows
X Visual Studio not installed; this is necessary for Windows development.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including following components:
MSBuild
MSVC v142 - VS 2019 C++ x64/x86 build tools
- If there are multiple versions, install the latest one
Windows 10 SDK (10.0.17763.0)

[√] Android Studio (version 3.5)
• Android Studio at K:\tools\android
• Flutter plugin version 40.2.2
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

[√] Connected device (3 available)
• Windows • Windows • windows-x64 • Microsoft Windows [Versione 10.0.18362.449]
• Chrome • chrome • web-javascript • Google Chrome 78.0.3904.97
• Web Server • web-server • web-javascript • Flutter Tools

! Doctor found issues in 2 categories.

Dart VM version: Dart VM version: 2.7.0 (Fri Nov 8 21:32:48 2019 +0000) on "windows_x64"

On channel master of flutter.

@venkatd

This comment has been minimized.

Copy link

@venkatd venkatd commented Nov 19, 2019

I'm having the same issue once I upgrade to Dart 2.7. Anyone find a workaround for this?

@thosakwe

This comment has been minimized.

Copy link
Member

@thosakwe thosakwe commented Nov 19, 2019

@thosakwe

This comment has been minimized.

Copy link
Member

@thosakwe thosakwe commented Nov 22, 2019

This is resolved in angel_framework@2.1.0, which I'm going to ship in a few minutes.

@thosakwe thosakwe closed this Nov 22, 2019
@thosakwe

This comment has been minimized.

Copy link
Member

@thosakwe thosakwe commented Nov 22, 2019

@massimoliani

This comment has been minimized.

Copy link
Author

@massimoliani massimoliani commented Nov 22, 2019

thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.