'Untyped function calls may not accept type arguments Nuxt Axios Typescript

I am using typescript with Nuxtjs and trying to fetch data with Axios instance on $axios

this is my code:

  this.$axios.get<ServerResponse>('/trainings/list')
    .then(response => {
      this.trainings = response.data.data;
    })
    .finally(() => {
      this.loading = false;
    });

In first line I get this error:

Untyped function calls may not accept type arguments.

This is my interface:

interface ServerResponse {
  data: Training[];
}
interface Training {
  id: number;
  slug: string;
  type: string;
  title: string;
  location: string;
  publishDate: string;
  description: string;
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source