theyashpatel / yt-react-weather-app

104 stars 34 forks source link

slice issue #4

Open Shikha0321 opened 1 year ago

Shikha0321 commented 1 year ago

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'slice') at formatForecastWeather (weatherService.js:48:1) at async getFormattedWeatherData (weatherService.js:75:1) at async fetchWeather (App.js:23:1)

Siddhesh1123 commented 1 year ago

same issue if you know the solution please let me know

hmongdev commented 1 year ago

@Shikha0321 @Siddhesh1123

I ran into the same issue.

The problem is that the Free API version no longer supports "daily" or "hourly", so the .slice function is reading undefined.

Solution: Remove Forecast components from App.jsx, and daily and hourly from weatherServices.js. This fixes the issue.

Siddhesh1123 commented 1 year ago

Yes ,Thanks you. I already done it thanks anyway 👍

Shashwat-pati commented 1 year ago

@yang2674 Can you please explain where to edit in App.js and weatherServices.js ?? I am not getting it.