Bug: NuxtAxiosInstance no longer exported
See original GitHub issueIssue
The interface is no longer exported from type definitions and also results in an issue with the vuex.d.ts
file:
https://github.com/nuxt-community/axios-module/blob/main/types/vuex.d.ts
as this will try to import it as well.
Solution:
NuxtAxiosInstance should be exported here:
https://github.com/nuxt-community/axios-module/blob/main/types/index.d.ts
Related and possibly related:
- https://github.com/nuxt-community/axios-module/issues/550 (could be mis-diagnosis because it does extend AxiosStatic, so perhaps the type isn’t imported for this user)
- https://github.com/nuxt-community/axios-module/issues/547 (same issue)
- https://github.com/nuxt-community/axios-module/issues/545 possible mis-diagnosis again as it should extend Axios interfaces which includes
get
Issue Analytics
- State:
- Created 2 years ago
- Reactions:10
- Comments:9
Top Results From Across the Web
Nuxt/TypeScript: Cannot access this - TS2339: Property 'XXX ...
After adding axios plug nuxt.config.js inside the plugins folder add axios-accessor.ts with the following content :
Read more >Getting Started With Axios In Nuxt - Smashing Magazine
In this tutorial, we will learn how to make a request in our Nuxt.js applications using the Axios module. We will also learn...
Read more >Extending axios - nuxtjs/axios
If you need to create your own axios instance which based on $axios defaults, you can use the create method. plugins/api.js export default ......
Read more >Separate business logic from UI in Vue.js application
import { Employee } from '~/types/employee' export interface ... export default class Employees { axios: NuxtAxiosInstance error: ...
Read more >Using Nuxt with the Vue 3 Class Based Components in ...
Its syntax is cleaner, mixins are no longer needed to separate concerns, ... import/no-mutable-exports let $axios: NuxtAxiosInstance export ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The solution is to use
import type
like so:import type { NuxtAxiosInstance } from '@nuxtjs/axios';
I have the same problem