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

Error when building application for web platform #943

Open
1 task
mpastuszka opened this issue Apr 30, 2024 · 4 comments
Open
1 task

Error when building application for web platform #943

mpastuszka opened this issue Apr 30, 2024 · 4 comments

Comments

@mpastuszka
Copy link

mpastuszka commented Apr 30, 2024

🐛 Bug Report

../../../../.pub-cache/hosted/pub.dev/cached_network_image_web-1.2.0/lib/cached_network_image_web.dart:159:12:
Error: The method 'createImageCodecFromUrl' isn't defined for the class 'ImageLoader'.

  • 'ImageLoader' is from 'package:cached_network_image_web/cached_network_image_web.dart'
    ('../../../../.pub-cache/hosted/pub.dev/cached_network_image_web-1.2.0/lib/cached_network_image_web.dart').
    return createImageCodecFromUrl(
    ^^^^^^^^^^^^^^^^^^^^^^^
    Error: Compilation failed.

Application builds on version cached_network_image_web-1.1.1 with no problems.

Expected behavior: Application is building on web

Reproduction steps: flutter build web --source-maps --web-renderer html

Configuration:

Flutter 3.13.6 • channel stable • https://github.com/flutter/flutter.git
Framework • revision ead455963c (7 months ago) • 2023-09-26 18:28:17 -0700
Engine • revision a794cf2681
Tools • Dart 3.1.3 • DevTools 2.25.0

Version: cached_network_image: 3.3.1
cached_network_image_web: 1.2.0

Platform:

  • :chrome: web
@mpastuszka mpastuszka changed the title Exception when building application for web platform Error when building application for web platform Apr 30, 2024
@shmink
Copy link

shmink commented May 1, 2024

I ran into the same problem on Monday (29/04/2024).

Here's my logs from my pipeline

#16 8.211 Compiling lib/main_web.dart for the Web...                      
#16 41.25 Target dart2js failed: ProcessException: Process exited abnormally:
#16 41.25 ../.pub-cache/hosted/pub.dev/carousel_slider-4.2.1/lib/carousel_slider.dart:358:33:
#16 41.25 Warning: Operand of null-aware operation '?.' has type 'PageStorageBucket' which excludes null.
#16 41.25  - 'PageStorageBucket' is from 'package:flutter/src/widgets/page_storage.dart' ('../fvm/versions/3.13.3/packages/flutter/lib/src/widgets/page_storage.dart').
#16 41.25                     PageStorage.of(storageContext)?.readState(storageContext)
#16 41.25                                 ^
#16 41.25 ../.pub-cache/hosted/pub.dev/cached_network_image_web-1.2.0/lib/cached_network_image_web.dart:159:12:
#16 41.25 Error: The method 'createImageCodecFromUrl' isn't defined for the class 'ImageLoader'.
#16 41.25  - 'ImageLoader' is from 'package:cached_network_image_web/cached_network_image_web.dart' ('../.pub-cache/hosted/pub.dev/cached_network_image_web-1.2.0/lib/cached_network_image_web.dart').
#16 41.25     return createImageCodecFromUrl(
#16 41.25            ^^^^^^^^^^^^^^^^^^^^^^^
#16 41.25 Error: Compilation failed.
#16 41.25   Command: /root/fvm/versions/3.13.3/bin/cache/dart-sdk/bin/dart --disable-dart-dev /root/fvm/versions/3.13.3/bin/cache/dart-sdk/bin/snapshots/dart2js.dart.snapshot --platform-binaries=/root/fvm/versions/3.13.3/bin/cache/flutter_web_sdk/kernel --invoker=flutter_tool -Ddart.vm.product=true -DENVIRONMENT=qa -DFLUTTER_WEB_AUTO_DETECT=false -DFLUTTER_WEB_USE_SKIA=false -DFLUTTER_WEB_CANVASKIT_URL=https://www.gstatic.com/flutter-canvaskit/b8d35810e91ab8fc39ba5e7a41bff6f697e8e3a8/ --native-null-assertions --no-source-maps -o /root/app/.dart_tool/flutter_build/247114a1b1fa7ff2737a4b92070ad05a/app.dill --packages=.dart_tool/package_config.json --cfe-only /root/app/.dart_tool/flutter_build/247114a1b1fa7ff2737a4b92070ad05a/main.dart
#16 41.25 #0      RunResult.throwException (package:flutter_tools/src/base/process.dart:125:5)
#16 41.25 #1      _DefaultProcessUtils.run (package:flutter_tools/src/base/process.dart:278:19)
  • flutter version: 3.13.3
  • cached_network_image: ^3.3.1

Locking version to 3.3.0 seems to fix the issue.

cached_network_image: 3.3.0

@chenshengfa0803
Copy link

same issue

@lehoangbaochung
Copy link

same energy

@Irvan-SSR
Copy link

pub.dev/cached_network_image_web-1.2.0/lib/cached_network_image_web.dart:159:12: Error: The method 'createImageCodecFromUrl' isn't defined for the class 'ImageLoader'. same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants