You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like using axios to get data from server is not working and it is stuck - no promise rejection or resolution is happening. I had to switch my data fetcher to classic fetch to get things work.
Test:
import axios from 'axios';
export function dataFetcher(url, data, params) {
return axios({
url,
method: data ? 'POST' : 'GET',
data,
...params,
});
}
Somewhere in the code
async getRouteData(routePath, language) {
try {
console.log('before response'); // output is visible in console
// get route data passing the cookies in request header
const response = await dataFetcher(routePath, language);
console.log('after response'); // output is NOT registered in console
const route = response && response.data
if (!route) {
throw new Error('Invalid route data was retrieved by layout service.', routePath);
}
return response.data;
} catch (error) {
console.warn('getRouteData error', error);
return null;
}
}
Axios is working normally for react-native run-android.
The text was updated successfully, but these errors were encountered:
It looks like using
axios
to get data from server is not working and it is stuck - no promise rejection or resolution is happening. I had to switch my data fetcher to classicfetch
to get things work.Test:
Somewhere in the code
Axios is working normally for
react-native run-android
.The text was updated successfully, but these errors were encountered: