krille-chan / fluffychat

The cutest instant messenger in the [matrix]
https://fluffychat.im/
GNU Affero General Public License v3.0
1.1k stars 191 forks source link

Web: Error: Type 'DecoderCallback' not found. #604

Closed daedric7 closed 1 month ago

daedric7 commented 11 months ago

Bug Description

I'm trying to build the web release, i got the latest code from git, and flutter is:

Flutter 3.16.0-6.0.pre.45 • channel master • https://github.com/flutter/flutter.git
Framework • revision e5d45753f7 (2 hours ago) • 2023-10-09 13:57:11 +0300
Engine • revision 2886353ee6
Tools • Dart 3.3.0 (build 3.3.0-1.0.dev) • DevTools 2.28.1

Installed from snap.

When building we get the error:

Target dart2js failed: ProcessException: Process exited abnormally:
/root/.pub-cache/hosted/pub.dev/flutter_blurhash-0.7.0/lib/src/blurhash_widget.dart:218:42:
Error: Type 'DecoderCallback' not found.
  ImageStreamCompleter load(UiImage key, DecoderCallback decode) => OneFrameImageStreamCompleter(_loadAsync(key));
                                         ^^^^^^^^^^^^^^^
/root/.pub-cache/hosted/pub.dev/flutter_blurhash-0.7.0/lib/src/blurhash_image.dart:32:48:
Error: Type 'DecoderCallback' not found.
  ImageStreamCompleter load(BlurHashImage key, DecoderCallback decode) => OneFrameImageStreamCompleter(_loadAsync(key));
                                               ^^^^^^^^^^^^^^^
/root/.pub-cache/hosted/pub.dev/flutter_math_fork-0.7.1/lib/src/widgets/selection/gesture_detector_builder_selectable.dart:38:22:
Error: Type 'TapDragUpDetails' not found.
  void onSingleTapUp(TapDragUpDetails details) {
                     ^^^^^^^^^^^^^^^^
/root/.pub-cache/hosted/pub.dev/go_router-10.1.0/lib/src/information_provider.dart:125:34:
Warning: Operand of null-aware operation '!' has type 'String' which excludes null.
      location: routeInformation.location!,
                                 ^
/root/.pub-cache/hosted/pub.dev/go_router-10.1.0/lib/src/parser.dart:87:50:
Warning: Operand of null-aware operation '!' has type 'String' which excludes null.
        configuration.findMatch(routeInformation.location!, extra: state.extra);
                                                 ^
/root/.pub-cache/hosted/pub.dev/scroll_to_index-3.0.1/lib/scroll_to_index.dart:482:32:
Warning: Operand of null-aware operation '!' has type 'RenderAbstractViewport' which excludes null.
 - 'RenderAbstractViewport' is from 'package:flutter/src/rendering/viewport.dart' ('/root/snap/flutter/common/flutter/packages/flutter/lib/src/rendering/viewport.dart').
        RenderAbstractViewport.of(renderBox)!;
                               ^
/root/.pub-cache/hosted/pub.dev/flutter_blurhash-0.7.0/lib/src/blurhash_widget.dart:218:42:
Error: 'DecoderCallback' isn't a type.
  ImageStreamCompleter load(UiImage key, DecoderCallback decode) => OneFrameImageStreamCompleter(_loadAsync(key));
                                         ^^^^^^^^^^^^^^^
/root/.pub-cache/hosted/pub.dev/flutter_blurhash-0.7.0/lib/src/blurhash_image.dart:32:48:
Error: 'DecoderCallback' isn't a type.
  ImageStreamCompleter load(BlurHashImage key, DecoderCallback decode) => OneFrameImageStreamCompleter(_loadAsync(key));
                                               ^^^^^^^^^^^^^^^
/root/.pub-cache/hosted/pub.dev/emoji_picker_flutter-1.6.1/lib/src/skin_tone_overlay.dart:72:15:
Warning: Operand of null-aware operation '?.' has type 'OverlayState' which excludes null.
 - 'OverlayState' is from 'package:flutter/src/widgets/overlay.dart' ('/root/snap/flutter/common/flutter/packages/flutter/lib/src/widgets/overlay.dart').
      Overlay.of(context)?.insert(_overlay!);
              ^
/root/.pub-cache/hosted/pub.dev/flutter_layout_grid-2.0.4/lib/src/widgets/layout_grid.dart:212:20:
Error: Inferred type argument 'AutoPlacement' doesn't conform to the bound 'Enum?' of the type variable 'T' on 'EnumProperty'.
 - 'AutoPlacement' is from 'package:flutter_layout_grid/src/widgets/layout_grid.dart' ('/root/.pub-cache/hosted/pub.dev/flutter_layout_grid-2.0.4/lib/src/widgets/layout_grid.dart').
 - 'Enum' is from 'dart:core'.
    properties.add(EnumProperty('autoPlacement', autoPlacement));
                   ^
/root/snap/flutter/common/flutter/packages/flutter/lib/src/foundation/diagnostics.dart:2258:20:
Info: This is the type variable whose bound isn't conformed to.
class EnumProperty<T extends Enum?> extends DiagnosticsProperty<T> {
                   ^
/root/.pub-cache/hosted/pub.dev/flutter_math_fork-0.7.1/lib/src/widgets/selection/gesture_detector_builder_selectable.dart:38:22:
Error: 'TapDragUpDetails' isn't a type.
  void onSingleTapUp(TapDragUpDetails details) {
                     ^^^^^^^^^^^^^^^^
Error: Compilation failed.
  Command: /root/snap/flutter/common/flutter/bin/cache/dart-sdk/bin/dart --disable-dart-dev /root/snap/flutter/common/flutter/bin/cache/dart-sdk/bin/snapshots/dart2js.dart.snapshot
  --platform-binaries=/root/snap/flutter/common/flutter/bin/cache/flutter_web_sdk/kernel --invoker=flutter_tool -Ddart.vm.product=true -DFLUTTER_WEB_AUTO_DETECT=true
  -DFLUTTER_WEB_CANVASKIT_URL=https://www.gstatic.com/flutter-canvaskit/2886353ee6126c2b43c564eb2f25e76210a9b7f9/ --native-null-assertions --no-source-maps -o
  /share/block50/fluffychat/.dart_tool/flutter_build/45c42e2b2448222c6dd90cadf2cd3189/app.dill --packages=.dart_tool/package_config.json --cfe-only
  /share/block50/fluffychat/.dart_tool/flutter_build/45c42e2b2448222c6dd90cadf2cd3189/main.dart
#0      RunResult.throwException (package:flutter_tools/src/base/process.dart:127:5)
#1      _DefaultProcessUtils.run (package:flutter_tools/src/base/process.dart:280:19)
<asynchronous suspension>
#2      Dart2JSTarget.build (package:flutter_tools/src/build_system/targets/web.dart:189:5)
<asynchronous suspension>
#3      _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:853:9)
<asynchronous suspension>
#4      Future.wait.<anonymous closure> (dart:async/future.dart:523:21)
<asynchronous suspension>
#5      _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:791:32)
<asynchronous suspension>
#6      Future.wait.<anonymous closure> (dart:async/future.dart:523:21)
<asynchronous suspension>
#7      _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:791:32)
<asynchronous suspension>
#8      FlutterBuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:620:16)
<asynchronous suspension>
#9      WebBuilder.buildWeb (package:flutter_tools/src/web/compile.dart:89:34)
<asynchronous suspension>
#10     BuildWebCommand.runCommand (package:flutter_tools/src/commands/build_web.dart:199:5)
<asynchronous suspension>
#11     FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1350:27)
<asynchronous suspension>
#12     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#13     CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#14     FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:348:9)
<asynchronous suspension>
#15     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#16     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:294:5)
<asynchronous suspension>
#17     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:112:9)
<asynchronous suspension>
#18     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#19     main (package:flutter_tools/executable.dart:90:3)
<asynchronous suspension>

Compiling lib/main.dart for the Web...                             57.4s
Exception: Failed to compile application for the Web.

Steps to Reproduce

  1. Install flutter
  2. Clone git
  3. ./scripts/prepare-web.sh
  4. flutter build web --release

Expected Behavior

The expected build.

App Version

NA

Additional Platform Information

Ubuntu Linux ARM64

Additional Context

Flutter is installed from snap as i cannot find the ARM64 release for linux on Flutter's website.

As such, i cannot downgrade flutter to test with a ancient version.

There is a warning that DecoderCallback is deprecated for a long time, and bound to be removed on 25th August 2023.

github-actions[bot] commented 10 months ago

This issue is stale because it has been open for 30 days with no activity.

verymilan commented 10 months ago

same here with manually installed (and upgraded) flutter.

github-actions[bot] commented 4 months ago

This issue is stale because it has been open for 120 days with no activity.

github-actions[bot] commented 1 month ago

This issue was closed because it has been inactive for 14 days since being marked as stale.