Hdoc1509 / dev-challenges

My solutions for DevChallenges and Legacy DevChallenges
MIT License
1 stars 0 forks source link

[Gihub Jobs] All services returns `Unkwon error` #4

Closed Hdoc1509 closed 1 month ago

Hdoc1509 commented 1 month ago

Inital Load

On initial load, Remaining Searches and Geolocation services return unkwon error, as shown in the following image:

github-jobs-api-unkwon-error

Searching

When trying to search, Jobs services shows the same eror:

github-josb-search-unkown-error

Hdoc1509 commented 1 month ago

Status Error

By checking Network tab in DevTools, all services returns an error status:

Geolocation and Remaining Searches

github-jobs-api-status-error-ready

Jobs

github-jobs-api-jobs-status-error

Hdoc1509 commented 1 month ago

Logs

By checking the logs of netlify functions, I found an error about a not defined variable:

github-jobs-netlify-funcions-variable-not-defined

Hdoc1509 commented 1 month ago

Weird code

By checking build output of Geolocation api, I found bad generated code that causes the previous error about GeolocationPositionError:

github-jobs-build-weird-code

Note: the only file where the previous object is declared is in @lib/geolocation

Oher api's

Jobs and Remaining searches api's are also importing some utils from output file of Geolocation api:

Remaining searches

github-jobs-remaining-searches-import

Jobs

github-jobs-jobs-import

Additional notes

Hdoc1509 commented 1 month ago

Geolocation utils

After checking Geolocation server service file, I found at this line an import of pickLocationOption() util from geolocation utils.

geolocation utils file is the only place where there is an import from @lib/geolocation, which declares an object by using GeolocationPositionError

Additional notes

Hdoc1509 commented 1 month ago

Local change

By moving pickLocationOptions() util to another file, Geolocation server output file does not contain the object with GeolocationPositionError interface