Some Images Are Not Displaying

As can be seen in the first image, most of the time, my images display properly and the formula returns a URL for the image.

But as seen in the second image, sometimes I get an error saying, “Cannot read properties of undefined (reading ‘photo_url’)”

Can I please get some help with fixing this? Does anybody know how to fix it?
The image links are valid, as the exact same images display just fine on other pages, so I’m not sure why its telling me its undefined.
Thanks!

try without the .photo_url to see what its returning for that photo maybe its not getting the correct details for some reason.

Just tried it with no luck. It says “undefined” when I do that. Thanks for trying to help tho

It will be an issue with what is in the collection then

The lookup fails to find the record you’re trying to reference. It returns undefined (meaning nothing) and so you get that error. Make your logic more sturdy, piece this together on the backend.. if you’re using Supabase, it’s very simple.

What kind of issue? Doesn’t make sense that it would work some of the time and not other times, when there is no difference

I’m not understanding how that could be tho. The logic is the same between the images that display correctly and the images that don’t display correctly. There is nothing different. The data is there, and the photo URLs are there, and they work fine. And yes I’m using Supabase and the connection between the tables is very straightforward and simple. Tbh this feels more like a WeWeb issue, but open to suggestions.

Try reading this, you might not need the lookup at all.

1 Like

I’ll take a look, thanks

if you give us some more info we might be able to help better, whats the collection fetched like, what does the data of property photos look like for the ones its failing on ect

I figured it out! Turns out it was cause of a setting in Supabase. I had hit the maximum number of rows returned from a table, which were set to limits payload size for accidental or malicious requests. I just increased the number.