React Axios Error in IE 11, but Not Chrome

Viewed 1990

The following works in Chrome, but gives Network Error in IE 11. Same with using Fetch instead of Axios. What am I missing?

async componentDidMount() {
    var auth = "Basic " + btoa(process.env.REACT_APP_CREDENTIAL);
    var state = this;

    Axios.get(
      process.env.REACT_APP_URL,
      {
        headers: {
          Accept: "application/json",
          "Content-Type": "application/json",
          Authorization: auth,
        },
        withCredentials: true,
      }
    )
      .then(function (response) {
        console.log(response.status);
        state.setState({ data: response.data.value });
      })
      .catch(function (error) {
        console.log(error);
      });
  }

error image

0 Answers
Related