title: $axios.onError is not a function
body: <p>I am using <a href="https://axios.nuxtjs.org" rel="nofollow noreferrer">nuxt community axios module</a>.</p>
  
  <p>And this is my plugin inside plugins/axios.js</p>
  
  <p>Everything was working fine but now all of a sudden I get the error <code>$axios.onError is not a function</code></p>
  
  <p>Here is my plugins/axios.js</p>
  
  <pre><code>export default function({ $axios, store, redirect }) {
      $axios.onError(error =&gt; {
          if (error.response.status === 422) {
              store.dispatch("validation/setErrors", error.response.data.errors);
              return redirect("/login");
          }
          return Promise.reject(error);
      });
  
      $axios.onRequest(config =&gt; {
          config.headers["Content-Type"] = "application/json";
          config.headers["Access-Control-Allow-Origin"] = "*";
  
          store.dispatch("validation/clearErrors");
      });
  }
  </code></pre>