Closed alsoicode closed 4 years ago
Hey @alsoicode, thanks for reaching out! We would need some additional information in order to investigate the issue - Could you reproduce the issue in a public repository we can debug? Did you follow the integration steps detailed here? I can see that you have both "@cloudinary/angular" and "@cloudinary/angular-5.x" installed on your environment. Could you try omitting the "@cloudinary/angular" installation?
"@cloudinary/angular": "2.1.1", "@cloudinary/angular-5.x": "1.3.1",
@eyalktCloudinary I discovered what the actual problem was after creating a working StackBlitz: https://stackblitz.com/edit/angular-ivy-fs8uaa
In my template, I had added a css class to the cl-image
tag:
<cl-image *ngFor="let photo of property.photos; let i = index" [ngClass]="{ 'mr-2': i < property.photos.length - 1, 'mb-3': true }" public-id="{{ photo.publicID }}">
<cl-transformation height="60" width="90" crop="fill"></cl-transformation>
</cl-image>
In the previous versions I was using:
cloudinary-core: 2.8.2 @cloudinary-angular-5.x: 1.2.2
this was working as expected. It's not a big deal, I can certainly add the styling differently, but as soon as I removed the [ngClass]
attribute, it works. So, this issue can be closed since it does in fact work with Angular 10, but something has definitely changed either in Angular or the cl-image
tag that is causing this to happen :)
Bug report for Cloudinary Angular SDK
Before proceeding, please update to latest version and test if the issue persists
Describe the bug in a sentence or two.
cli-image
tag returns a syntax errorIssue Type (Can be multiple)
Behaviour - Functions aren’t working as expected (Such as generate URL)
Steps to reproduce
Add a
cl-image
tag and specify a valid public-idError screenshots
Syntax error:
ERROR SyntaxError: Unexpected token o in JSON at position 1 at JSON.parse ()
at transformKeyNames (cloudinary-angular-5.x.js:68)
at cloudinary-angular-5.x.js:86
at Array.forEach ()
at transformKeyNames (cloudinary-angular-5.x.js:80)
at Cloudinary.toCloudinaryAttributes (cloudinary-angular-5.x.js:159)
at CloudinaryImage.loadImage (cloudinary-angular-5.x.js:522)
at CloudinaryImage.ngAfterViewInit (cloudinary-angular-5.x.js:469)
at callHook (core.js:2922)
at callHooks (core.js:2892)
Browsers (if issue relates to UI, else ignore)
All
Versions and Libraries (fill in the version numbers)
Angular Cloudinary SDK - 1.3.1 Angular - 10.0.4 Node - 14.5.0 NPM - 6.14.5
Config Files (Please paste the following files if possible)
Repository
Repository is private. Can't share publicly.