Skip to content

Commit

Permalink
Merge branch 'main' into fix/cloudinary-loader-ts
Browse files Browse the repository at this point in the history
  • Loading branch information
vickywane authored Oct 15, 2024
2 parents 2aeaa87 + 7ddd5c3 commit 687b45e
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 41 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# [6.15.0](https://github.com/cloudinary-community/next-cloudinary/compare/v6.14.2...v6.15.0) (2024-10-15)


### Features

* Log x-cld-error on image error ([#553](https://github.com/cloudinary-community/next-cloudinary/issues/553)) ([711c759](https://github.com/cloudinary-community/next-cloudinary/commit/711c75989d30ef544f69914efdb961bd0963d492)), closes [#512](https://github.com/cloudinary-community/next-cloudinary/issues/512)

## [6.14.2](https://github.com/cloudinary-community/next-cloudinary/compare/v6.14.1...v6.14.2) (2024-10-14)


Expand Down
4 changes: 2 additions & 2 deletions next-cloudinary/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next-cloudinary",
"version": "6.14.2",
"version": "6.15.0",
"license": "MIT",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
Expand All @@ -18,7 +18,7 @@
"dependencies": {
"@cloudinary-util/types": "1.5.10",
"@cloudinary-util/url-loader": "5.10.4",
"@cloudinary-util/util": "^3.3.2"
"@cloudinary-util/util": "4.0.0"
},
"devDependencies": {
"@babel/core": "^7.25.2",
Expand Down
9 changes: 7 additions & 2 deletions next-cloudinary/src/components/CldImage/CldImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,13 @@ const CldImage = forwardRef<HTMLImageElement, CldImageProps>(function CldImage(
const result = await pollForProcessingImage({ src: image.src });

if (result) {
setImgKey(`${defaultImgKey};${Date.now()}`);
}
if ( typeof result.error === 'string' && process.env.NODE_ENV === 'development' ) {
console.error(`[CldImage] Failed to load image ${props.src}: ${result.error}`)
}

if ( result.success ) {
setImgKey(`${defaultImgKey};${Date.now()}`);
}
}

const handleOnError = useCallback(onError, [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const CldUploadWidget = ({
const isSuccess = results.event === 'success';

if ( isSuccess && typeof onUpload === 'function' ) {
if ( process.env.NODE_ENVIRONMENT === 'development' ) {
if ( process.env.NODE_ENV === 'development' ) {
console.warn('The onUpload callback is deprecated. Please use onSuccess instead.');
}
onUpload(results, widget.current);
Expand Down
43 changes: 7 additions & 36 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 687b45e

Please sign in to comment.