Since the latest Chrome update, when developing my React app locally I am getting a warning in Chrome, as per the title that links me to https://www.chromestatus.com/feature/5629709824032768
The problem seems to be that I am developing on localhost, but I am calling my development domain https://dev-api.example.com
My API allows access for all requests, and this wasn't an issue before 5th March which is when the above article was updated.
I can see the requests going out in the Network tab, but I am unable to see the responses or log them out. As you can see below, it shows the truncated response, but clicking the dropdown arrow doesn't do anything
My code to call the API is pretty straight forwards too
return axios({
method: 'POST',
headers: {
'Authorization': `Bearer ${jwt}`
},
data,
url: `${process.env.REACT_APP_API}${url}`,
}).then(response => {
if(process.env.NODE_ENV === "development") console.log(`POST:`, response);
if (response && response.data.success) return response.data.data || response.data.success;
if(response.data.errors[0] === "E_UNAUTHENTICATED") {
return window.location = '/login?msg=Session Expired';
}
if(response.data.errors) {
return Promise.reject(new Error('An unknown error occurred'));
}).catch(e => {
return Promise.reject(e.message);
})