dfa1234 / ngx-image-compress

Angular library for uploading and compressing images
https://image-library.app
MIT License
86 stars 36 forks source link

Doesn't work with version 12 of Angular #90

Closed broomfn closed 2 years ago

broomfn commented 2 years ago

Hi,

I'm trying to use with version 12 of Angular, but you don't appear to have a version that's compatible?

$ node --version
v16.15.0
$ npm --version
8.10.0

npm ERR! Conflicting peer dependency: @angular/common@11.2.14
npm ERR! node_modules/@angular/common
npm ERR!   peer @angular/common@"^11.0.1" from ngx-image-compress@11.0.3
npm ERR!   node_modules/ngx-image-compress
npm ERR!     ngx-image-compress@"^11.0.3" from the root project

Any help gratefully received.

Many thanks

Neil

broomfn commented 2 years ago

For anyone else with this issue I had to provide these overrides to the package,json

"overrides": {
    "ngx-image-compress": {
      "@angular/common": "12.2.16",
      "@angular/core": "12.2.16"
    }
}
dfa1234 commented 2 years ago

I see that you are trying to install ngx-image-compress@11.0.3 which is outdated.

Please try with the last version (13.1.10 actually)

For simplicity we try to keep the library version number similar to angular one.

So 11 is compatible with 11 12 with 12 13 with 13

Etc etc.... But still, please use only the last version if you are not sure.

broomfn commented 2 years ago

Hi @dfa1234 , the problem with version 13.1.10 is that it's targeting version 13 of Angular, I'm unable to upgrade to version 13 as this would require me to also upgrade Ionic to version 6. Basically you don't appear to have a version of your library that's targeting version 12 of Angular, please correct me if I'm wrong.

broomfn commented 2 years ago

12 with 12

Where is version 12 of this library please? I can't see it on npm.

dfa1234 commented 2 years ago

Anyway every version before 13.1.8 should not be used. There is an important fixes because browser like chrome made important changes. I thinks we need to change the way we ask for version. Any version of angular > 4 should be ok, the library is meanly static javascript anyway. I'm re opening this and will update soon

dfa1234 commented 2 years ago

I hope version 13.1.12 now working with angular 12, out of the box, without other shenanigan in package.json

Because angular 13 dropped totally view engine support and compile in Ivy (partial mode) only, we are now officialy dropping support for any version of angular < 9. 8 could work potentially too but some configuration is needed to optin ivy support.

Here the recap:

image