airbnb-sanity-frontend icon indicating copy to clipboard operation
airbnb-sanity-frontend copied to clipboard

TypeError: Cannot read property 'length' of undefined

Open krish-shahh opened this issue 2 years ago • 3 comments

{property.reviews.length} review

What is the issue with this line so I can successfully deploy the frontend

krish-shahh avatar Mar 17 '22 22:03 krish-shahh

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>

safarsafarov avatar Jun 18 '22 13:06 safarsafarov

Same here, cannot display the data on the cards. There is no error, just not showing. :(

fernandofas avatar Jun 21 '22 11:06 fernandofas

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

AugustoDiaz-Dev avatar Aug 17 '22 15:08 AugustoDiaz-Dev