Devben
Devben•11mo ago

User imageURL not working

After successful clerk integration with convex.... I can see the username and fullname and other properties but the imagerURL property is not working.
2 Replies
Devben
DevbenOP•11mo ago
Code: <Image alt={@${user?.username} Image} src={user?.imageUrl} width={50} height={50}/> error: Type 'string | undefined' is not assignable to type 'string | StaticImport'. Type 'undefined' is not assignable to type 'string | StaticImport'. I know this maybe a small bug but been battling with it since lol 😂 <Image alt={@${user?.username} Image} src={user?.imageUrl ?? ''} width={50} height={50}/>
ian
ian•10mo ago
Yeah if imageUrl doesn't exist, or user doesn't exist, you might not want to show the image. If you are sure both exist you could do user!.imageUrl! or user && user.imageUrl && <Image ... src={user.imageUrl!... if you want to be safe

Did you find this page helpful?