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

[Bug] Unhandled runtime error when using CldImage component #227

Closed
smithmanny opened this issue Jul 8, 2023 · 5 comments · Fixed by #229
Closed

[Bug] Unhandled runtime error when using CldImage component #227

smithmanny opened this issue Jul 8, 2023 · 5 comments · Fixed by #229
Labels

Comments

@smithmanny
Copy link

Bug Report

Describe the bug

Whenever I try and use the CldImage component on my Next JS 13 site (using pages) I get an error ```Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.

Check the render method of he.```

I'm using next-cloudinary 4.13.1 and also cloudinary 1.37.3 to delete images

Is this a regression?

Yes

14.12.0

Steps To Reproduce the error

  1. Install and setup next-cloudinary
  2. Add component to file and page throws error

Screenshot or Video Recording

image

Your environment

  • OS: Mac OSX 12.6
  • Node version: Node 18
  • Npm version: Yarn 1.22.19
  • Browser name and version: Brave Browser 1.52.129

Additional context

@smithmanny smithmanny closed this as not planned Won't fix, can't repro, duplicate, stale Jul 8, 2023
@colbyfayock
Copy link
Collaborator

hey @smithmanny glad to see it looks like you got this resolved, if this was some kind of issue with the component that i can make clear or easier to use, even if simply something in the docs, would love any feedback!

@smithmanny
Copy link
Author

I found out that the problem came from updating next from 13.4.4 -> 13.4.9

@colbyfayock
Copy link
Collaborator

for anyone following along, im able to reproduce this: https://twitter.com/colbyfayock/status/1677783476014030849

im suspecting the issue is in how tsup is bundling or theres a bug in Next.js, not totally sure on this one at the moment

@colbyfayock colbyfayock reopened this Jul 8, 2023
@colbyfayock
Copy link
Collaborator

looks like this is a known issue: vercel/next.js#52216

colbyfayock added a commit that referenced this issue Jul 11, 2023
# Description

Due to some configuration of bundling with tsup and wrapping next/image,
we're getting a runtime error.

This seems to happen in the latest version `13.4.9` and at least 1
before

This uses a temporary workaround borrowed from:
prismicio/prismic-next#79 (thanks Angelo!)

This should be reverted or addressed in a more appropriate way once a
better solution is determined.

## Issue Ticket Number

Fixes #227 

<!-- Specify above which issue this fixes by referencing the issue
number (`#<ISSUE_NUMBER>`) or issue URL. -->
<!-- Example: Fixes
https://github.com/colbyfayock/next-cloudinary/issues/<ISSUE_NUMBER> -->

## Type of change

<!-- Please select all options that are applicable. -->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] Fix or improve the documentation
- [ ] This change requires a documentation update


# Checklist

<!-- These must all be followed and checked. -->

- [ ] I have followed the contributing guidelines of this project as
mentioned in [CONTRIBUTING.md](/CONTRIBUTING.md)
- [ ] I have created an
[issue](https://github.com/colbyfayock/next-cloudinary/issues) ticket
for this PR
- [ ] I have checked to ensure there aren't other open [Pull
Requests](https://github.com/colbyfayock/next-cloudinary/pulls) for the
same update/change?
- [ ] I have performed a self-review of my own code
- [ ] I have run tests locally to ensure they all pass
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes needed to the documentation
github-actions bot pushed a commit that referenced this issue Jul 11, 2023
## [4.14.1](v4.14.0...v4.14.1) (2023-07-11)

### Bug Fixes

* Temporary Fix for next/image Error Element Type is Invalid ([#229](#229)) ([f83c298](f83c298)), closes [#227](#227)
@github-actions
Copy link

🎉 This issue has been resolved in version 4.14.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

cham74 added a commit to cham74/next-image-delivery that referenced this issue Dec 23, 2023
## [4.14.1](cloudinary-community/next-cloudinary@v4.14.0...v4.14.1) (2023-07-11)

### Bug Fixes

* Temporary Fix for next/image Error Element Type is Invalid ([#229](cloudinary-community/next-cloudinary#229)) ([f83c298](cloudinary-community/next-cloudinary@f83c298)), closes [#227](cloudinary-community/next-cloudinary#227)
@colbyfayock colbyfayock mentioned this issue Feb 22, 2024
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants