nuxt-community / axios-module

Secure and easy axios integration for Nuxt 2
https://axios.nuxtjs.org
MIT License
1.19k stars 245 forks source link

Progress bar not working with Nuxt Composition API #486

Closed aaronhuisinga closed 3 years ago

aaronhuisinga commented 3 years ago

We seem to have an issue with the progress bar not showing during requests made from the Nuxt Composition API.

If we make a standard request:

<script>
export default {
  mounted() {
    this.$axios.get("/api/v1/testing");
  },
};
</script>

We see the progress bar and get the expected response.

However, if we make a similar request using the Composition API:

<script>
export default defineComponent({
  setup(_, { root }) {
    const { $axios } = useContext();
    $axios.get("/api/v1/testing");
  }
});
</script>

No progress bar is shown. @danielroe any idea what could be causing this issue?

aaronhuisinga commented 3 years ago

This is actually not correct. It has to do with Nuxt watchers when navigating routes. I'll open an issue for the Composition API.