tamitchell / weatherapp

A React Based Application that uses OpenWeather's web API to gather weather data and Geocodio's API to render weather conditions based on user's desired location
https://weatherapp-nine-mauve.vercel.app
0 stars 0 forks source link

API URL Resolution Bug in main/dev/preview Environment #32

Closed tamitchell closed 2 weeks ago

tamitchell commented 2 weeks ago

API requests are failing in the Vercel preview environment due to incorrect URL construction. The requests are being made to invalid URLs that include "undefined" in the path.

When accessing the app in Vercel's preview environment, API requests are failing with 404 errors. The console shows requests being made to:

https://weatherapp-git-dev-tashas-projects-4e4847e8.vercel.app/**undefined**/api/weather/...

I expect: API requests should be made to the correct base URL without "undefined" in the path:

Errors found

Failed to load resource: the server responded with a status of 404 () /undefined/api/weather/forecast?lat=40.7128&lng=-74.006&units=imperial /undefined/api/weather?lat=40.7128&lng=-74.006&units=imperial /undefined/api/weather/air_pollution?lat=40.7128&lng=-74.006&units=imperial