Error on ListingScreen after adding api

Ever since I added apisauce and backend, I’m getting the following error on ListingScreen.js.

Cant even debug properly because of this it seems. Thoughts?

It looks like ListingScreen.js is not getting the listings object – so you need to backtrack through the components that get the list from the backend and look for errors.

This includes all the components and imported (listingsApi from api/listings, useApi from hooks/useApi).

Make sure that the dev apiUrl is correct in config/settings.js. I ran into a problem with this when I had to reset my wireless router and it assigned a new IP address to my laptop.

Also, if you didn’t already, verify that your backend is working using Postman.

Hope this helps.

I have the same issue when the app is connected to backend. :frowning:

The backend is working properly and was checked through Postman. The problem seems to be related to .data part of which is not recognized on the frontend ( the received API data can be printed on the console only using console.log(response) and not when .data is added). Any suggestion on how to fix this problem ?

went back into the files and as it turns out, made a stupid typo in listings.js :

const endpoint = “./listings”;

(inserted the dot at the beginning). all working now, thanks!

1 Like

Did you try JSON.stringify(

I am stuck on the same error sadly :frowning: … I’ve tried checking all over stack overflow etc about keyExtractor in FlatList but it’s just confirming the way im doing it is correct. Alongside this, checking my listings screen in comparison to mosh’s - my keyExtractor is exactly the same so there should be no issue… I would appreciate any help!

I also tried changing the dot at the beginning of ‘./listings’ and did not fix my issue sadly :frowning: