I can not use ionic-image-loader in ionic 5 over · Issue #283 · zyra/ionic-image-loader · GitHub
Skip to content

I can not use ionic-image-loader in ionic 5 over  #283

Open

Description

@tinycoding5

ionic-angular plugin updated to @ionic/angular.
So i can not use this ionic-image-loader plugin.
I have replace import { } from 'ionic-angular' to '@ionic/angular' in node module.
But this is not good way. And then that made many errors.
So ionic-image-loader plugin version need to update, in my opinion

Activity

  1. changed the title [-]I can not use in ionic 5 over[/-] [+]I can not use ionic-image-loader in ionic 5 over [/+] on Apr 21, 2020
  2. tinycoding5 commented on Apr 21, 2020

    @tinycoding5
    Author

    After I have replace ionic-angular to @ionic/angular, i have got error.
    Here is error;
    Uncaught Error: Can't resolve all parameters for ImageLoader: ([object Object], ?, [object Object], [object Object]).
    at syntaxError (vendor-es2015.js:12780)
    at CompileMetadataResolver._getDependenciesMetadata (vendor-es2015.js:30771)
    at CompileMetadataResolver._getTypeMetadata (vendor-es2015.js:30666)
    at CompileMetadataResolver._getInjectableTypeMetadata (vendor-es2015.js:30884)
    at CompileMetadataResolver.getProviderMetadata (vendor-es2015.js:30893)
    at providers.forEach (vendor-es2015.js:30831)
    at Array.forEach ()
    at CompileMetadataResolver._getProvidersMetadata (vendor-es2015.js:30791)
    at flattenAndDedupeArray.forEach (vendor-es2015.js:30422)
    at Array.forEach ()

    How can I solve this issue?

  3. benzata commented on Apr 23, 2020

    @benzata

    I could not manage to make it work either.. I believe it is not working for Ionic 5. Can someone please confirm?

  4. ernes128 commented on Apr 30, 2020

    @ernes128

    I could not manage to make it work either.. I believe it is not working for Ionic 5. Can someone please confirm?

    I'm not from the team who developed this package but I can confirm that is not working on Ionic 5. Since what I see the author has this repo abandoned I cloned it and tried to update the dependencies to make it compatible with angular 9 and ionic 5 but there are a lot of deprecations and breaking changes between versions.

    The last angular stable version that this package supports is Angular 5. Starting to Angular 6 and above you will start getting warning and errors about deprecations or references not found in the packages.

    Hope at least give you some idea about the status of the project. Maybe if there's someone who has a lot of time to migrate it to support the latest Angular and Ionic version this repo could back to live again.

  5. lestrell commented on Jun 26, 2020

    @lestrell

    Hi @ernes128,

    This is hacky, but you can run this script on post install or pre build:
    `
    const fs = require("fs");

    const filePaths = [
    "./node_modules/ionic-image-loader/dist/providers/image-loader.js",
    "./node_modules/ionic-image-loader/dist/image-loader.module.js",
    "./node_modules/ionic-image-loader/dist/providers/image-loader.d.ts",
    ];
    let replace = "'@ionic-native/file'";
    let replaceWith = "'@ionic-native/file/ngx'";

    for(let filePath of filePaths) {
    let lang = fs.readFileSync(filePath, "utf8");
    lang = lang.replace(replace, replaceWith);
    fs.writeFileSync(filePath, lang, "utf8")
    }

    console.log("Done!")

    `

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions