Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

249
Views
Error serializing `propertiesForSale` returned from`getStaticProps` in "/". Reason: `undefined` cannot be serialized as JSON. Why cant i get listing?

---------------------------------------index.js---------------------------------------------------

   export async function getStaticProps() {
    const propertyForSale = await fetchApi(`${baseUrl}/properties/v2/list-for-rent? 
    locationExternalIDs=chicago&purpose=for-sale&hitsPerPage=6`);
    const propertyForRent = await fetchApi(`${baseUrl}/properties/v2/list-for-rent? 
    locationExternalIDs=chicago&purpose=for-rent&hitsPerPage=6`);

  return {
    props: {
      propertiesForSale: propertyForSale?.hits,
      propertiesForRent: propertyForRent?.hits,
    },
  };

}

------------------------------------fetchapp.js---------------------------------------------------

import axios from "axios";

export const baseUrl = "https://realty-in-us.p.rapidapi.com"

export const fetchApi = async (url) => {
const {data} = await axios.get((url), {
    headers: {
        'x-rapidapi-host': 'realty-in-us.p.rapidapi.com',
        'x-rapidapi-key': '4277ced7abmsh15ad7f4bdb95360p11b5a3jsnd6caf2e971dd'
      }
})
return data;
}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!