CodeWithHarry / NewsMonkey-React

News App created using React and NewsAPI
268 stars 205 forks source link

TypeError: Cannot read properties of undefined (reading 'length') #13

Open steven971998 opened 2 years ago

steven971998 commented 2 years ago

I even changed my API key still its not working. someone please help fast. NewsMonkey app error screenshot

Ads2405 commented 2 years ago

I am getting same error did u find any solutions?

steven971998 commented 2 years ago

No bro. Sad.

Ads2405 commented 2 years ago

i got a solution just increment the number of pages int the api URL also and paste the , setPage(page+1) above the url . Actually the page is rendering before turning to page +1.

steven971998 commented 2 years ago

i got a solution just increment the number of pages int the api URL also and paste the , setPage(page+1) above the url . Actually the page is rendering before turning to page +1.

Did it work? can you just screenshot your code and the changes you did to make it work please? i am still not getting it. its not working in mine.

Ads2405 commented 2 years ago

just take it from harry repo only , mine is same

steven971998 commented 2 years ago

just take it from harry repo only , mine is same

His code is not working in mine. So I wanted to see your code to know what changes you have made to solve this error.

Ads2405 commented 2 years ago

mine is as exact as his.....maybe just let ur be in class based only dont convert to props...........mine is props total similar to his

hackerbotsupreme commented 1 year ago

hello sir . sir i cloned your newsmonkey repo and tried to launch it with react ..... i dont know how this error , can some one please tell me how to solve this .... i am new in react Screenshot (6857)

Rahulsukare commented 1 year ago

I got similar error but resolved after updating API key in App.js we need to make sure to use our API key instead of process.env.REACT_APP_NEWS_API We are getting error because our article array is remains empty because NewsAPI is unable to fetch data.

tarun8367 commented 1 year ago

may be your limit is exhausted . Either wait for it to reset or use a different one. Hope it helps