I am making an axios GET
request on IE and both the code within the then
and catch
callbacks are both being executed. Firstly it is successful, and then it runs into the error block.
This is only happening on Internet Explorer. Works fine on Chrome, safari and firefox.
Can anyone spot a silly error I may be making.
export const getData = () => {
return dispatch => {
dispatch(getDataRequest());
// This appears once in the console
console.log('CALLED');
axios.get(`${cmsPath}/casinocms.cache.json`).then(res => {
// Firstly I see this in the console
console.log('NO ERROR!');
dispatch(getDataSuccess(res.data));
}).catch(err => {
// I then also see this message in the console,
// following the message above
console.log('ERROR!')
dispatch(getDataError(err));
});
};
};