title: Uncaught (in promise) TypeError: response.json is not a function
body: <p>I am trying to load a data from my firebase backend but getting this error </p>
  
  <pre><code>Uncaught (in promise) TypeError: response.json is not a function
  </code></pre>
  
  <p>my code is as below :</p>
  
  <pre><code>import axios from 'axios';
  export const loadData = ({ commit }) =&gt; {
    console.log('getting data from server...');
  
    axios
      .get('data.json')
      .then(response =&gt; response.json())
      .then(data =&gt; {
        if (data) {
  
          const stocks = data.stocks;
          const stockPortfolio = data.stockPortfolio;
          const funds = data.funds;
  
          const portfolio = {
            stockPortfolio,
            funds
          };
          commit('SET_STOCKS', stocks);
          commit('SET_PORTFOLIO', portfolio);
          console.log('Commit done ');
        }
      });
  };
  </code></pre>
  
  <p>however if I try response.data instead of response.json the it works and successfully loads the data, so I am curious whats the difference and why the first one doesn't work.</p>