I'm fetching a json file using axios in my react project. The rquest is made and I get a response on my localhost. However, on github pages when I deploy, the request is not made. I double checked using the networks tab in chrome devtools.
My code
the url I'm requesting: here
You are making the request when your component unmounts (cleanup function) instead on its mount. Instead of returning a function in useEffect you should do the request directly.
useEffect(() => {
axios.get('https://scaleflex.cloudimg.io/v7/0.fe_task_static/pictures.json?vh=7a646d&func=proxy').then((res) => {
setImages(res.data);
});
}, []);