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

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

Open
tinycoding5 opened this issue Apr 21, 2020 · 4 comments
Open

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

tinycoding5 opened this issue Apr 21, 2020 · 4 comments

Comments

@tinycoding5
Copy link

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

@tinycoding5 tinycoding5 changed the title I can not use in ionic 5 over I can not use ionic-image-loader in ionic 5 over Apr 21, 2020
@tinycoding5
Copy link
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?

@benzata
Copy link

benzata commented Apr 23, 2020

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

@ernes128
Copy link

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.

@lestrell
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants