cloudinary / cloudinary_angular

Cloudinary Angular client library
MIT License
305 stars 228 forks source link

Cloudinary Angular-5.x is not Angular 9 compatible #272

Closed hassanasad closed 4 years ago

hassanasad commented 4 years ago

Even though the release notes of 1.2.2 say that its Angular 9 compatible - i am getting following error when updating my Angular project.

Package "@cloudinary/angular-5.x" has an incompatible peer dependency to "@angular/core" (requires "^6.0.0" (extended), would install "9.1.1").
Package "@cloudinary/angular-5.x" has an incompatible peer dependency to "@angular/common" (requires "^6.0.0" (extended), would install "9.1.1").
aditimadan-Cloudinary commented 4 years ago

For reference: https://codesandbox.io/s/cloudinary-angular-media-library-ofmex . This one is using Angular 10 and it is compatible with the cloudinary libs. Can you please try using the same versions and test.

hassanasad commented 4 years ago

I believe you can replicate this issue by running: ng update @angular/cli @angular/core command. It will throw the errors i mentioned above.

strausr commented 4 years ago

@hadarbj Thanks for the information. For future reference, please note that we have an error template where you can specify more information when opening such issues.

The issue which you are describing is related to ng-update. In the meantime, can you please try using npm install to update @angular/cli @angular/core ?

hassanasad commented 4 years ago

@strausr Sure. Yes with NPM install it works. However each time we update Angular we use the ng-update because of any migrations etc that might be required with it. I believe this issue can be resolved by declaring the Angular version strings as a range maybe.

hassanasad commented 4 years ago

Some libraries do it like this:

"peerDependencies": {
    "@angular/common": ">=7.0.0",
    "@angular/core": ">=7.0.0"
  },

Perhaps you can see this for reference: https://github.com/valor-software/ngx-bootstrap/blob/development/package.json

strausr commented 4 years ago

@hassanasad Thanks for the advice and feedback:) we'll discuss this internally and update here if we decide to change anything

bjornharvold commented 4 years ago

Yes, please bump peer dependency to Angular 10. Have to --force an "ng update" which shouldn't be necessary.

strausr commented 4 years ago

@bjornharvold will be handled in the next release

abbasogaji commented 4 years ago

@aditimadan-Cloudinary Cloudinary module is not compatible with angular 9+, the angular cloudinary library doesnt return ModuleWithProviders with a generic type.

"Angular version 9 deprecates use of ModuleWithProviders without an explicitly generic type, where the generic type refers to the type of the NgModule. In a future version of Angular, the generic will no longer be optional."

Currently can't use Cloudinary on Angular 10

eyalktCloudinary commented 4 years ago

@abbasogaji thank you for your feedback! Note that the Cloudinary module does return ModuleWithProviders with a generic type - https://github.com/cloudinary/cloudinary_angular/blob/master/projects/angular-cld/src/lib/cloudinary.module.ts#L61

ModuleWithProviders\<CloudinaryModule>

Can you please recreate the issue, and elaborate on where are you seeing different behavior? Is your version of the Cloudinary module up to date?

abbasogaji commented 4 years ago

I guess i installed the older version, let me try with the newer version

abbasogaji commented 4 years ago

@eyalktCloudinary @aditimadan-Cloudinary it works fine (v1.3.1) on Angular 10

eyalktCloudinary commented 4 years ago

@abbasogaji Glad to hear it's working!