CodeWithHarry / NewsMonkey-React

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

TypeError: Cannot read property 'length' of undefined #1

Closed BabbarRaghav closed 2 years ago

BabbarRaghav commented 2 years ago

mere code me ek problem aa rahi hai... Agar me apna code localhost me run karu to sahi chal raha hai but agar me apna code "on your network" wale link se karu to error aa raha hai:- TypeError: Cannot read property 'map' of undefined Me purani video dubara dekhi sari check karne ke liye me kya galti ker raha hu per kuch nahi mil raha Please harry bhai ya or koi help kerdo. image

eklavyadev commented 2 years ago

This problem is encountered may be due to ease in using a non-strict mode You should add "use strict"; at the top of your react app and find what actually the error is

gramo37 commented 2 years ago

This may be because you exhausted your api requests for the day. Check your requests left for the day in news API.

gramo37 commented 2 years ago

If you want to continue your work you can use your brother's or any other family members details to get a new API key, and just replace the API key. It worked for me.

Shivam2001-programmer commented 2 years ago

Type Error: Cannot read property'map' of undefined at localhost :3000 please Bhaiya resolved this 16303237854781370110448877429764

Shivam2001-programmer commented 2 years ago

Type Error: Cannot read property'map' of undefined at localhost :3000

eklavyadev commented 2 years ago

https://stackoverflow.com/questions/24706267/error-cannot-read-property-map-of-undefined I think this might solve your problems

WindingSnow commented 2 years ago

@Shivam2001-programmer The news API only works at your localhost.