I just upgraded to next 14 from 13 and started seeing this error anywhere i use next/image. Searching far and wide, i have not found any solution...
Error:
Unhandled Runtime 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 `CustomerLogo`.
Component:
import Image, { ImageProps } from "next/image";
export const CustomerLogo = ({ src, ...rest }: Partial<ImageProps>) => {
if (!src) {
return null;
}
return (
<Image
// TODO: replace with alt text from the service, once it is available
alt="foo"
src={src}
style={{ objectFit: "contain" }}
fill
unoptimized
{...rest}
/>
);
};
Without the next/image, there is no error. Any help would be appreciated. I've been stuck on this all day...