airbnb-sanity-frontend
airbnb-sanity-frontend copied to clipboard
TypeError: Cannot read property 'length' of undefined
{property.reviews.length} review
What is the issue with this line so I can successfully deploy the frontend
Server Error
TypeError: Cannot read properties of undefined (reading 'current') This error happened while generating the page. Any console logs will be displayed in the terminal window. Source
pages/index.js (17:54) @ eval
15 | <div className="feed">
16 | {properties.map((property) => (
> 17 | <Link href={`property/${property.slug.current}`}>
| ^
18 | <div key={property._id} className="card">
19 | <img src={urlFor(property.mainImage)} />
20 | <p>
Same here, cannot display the data on the cards. There is no error, just not showing. :(
Guys, check out you have some images to display. I solved when I uploaded some images. Also there is some issue with the imports of the images in the config file, check it out:
https://stackoverflow.com/questions/71277628/typeerror-0-next-sanity-webpack-imported-module-0-createimageurlbuilder