title: can't fetch image from api in nextjs - TypeError: Cannot read properties of undefined (reading 'map') NEXTJS
body: <p>I can't seem to fetch an image from the api, not sure what's going on. What am I missing here?</p>
  <p>I also keep getting this error in the browser.</p>
  <p>Image is missing required &quot;src&quot; property. Make sure you pass &quot;src&quot; in props to the <code>next/image</code> component. Received: {}
  null</p>
  <p>images in <code>console.log</code> produces undefined.</p>
  <pre><code>function Images({images}) {
   
      
      return (
          &lt;div&gt;
      {images?.map((image)=&gt; (
          &lt;Image src={image.url}/&gt;
      ))}    
          &lt;/div&gt;
      )
  }
  
  export async function getStaticProps() {
      const res= await fetch ('https://obmng.dbm.guestline.net/api/hotels?collection-id=OBMNG')
      const images = await res.json()
  
  return {
      props: {
          images,
      },
  }
  
  }
  
  export default Images
  </code></pre>