question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ESLint: NuxtAxiosInstance not found in '@nuxtjs/axios'(import/named)

See original GitHub issue
// package.json

"@nuxtjs/axios": "^5.13.6",
"nuxt": "^2.15.7",
import { Context } from '@nuxt/types'
import { NuxtAxiosInstance } from '@nuxtjs/axios'

const someFunc = (context: Context) => {
  const { $axios }: { $axios: NuxtAxiosInstance } = context;
  $axios.get("something")
}

ES Lint throws following errro:

error NuxtAxiosInstance not found in ‘@nuxtjs/axios’ import/named

I looked inside axios/types/index.d.ts and there are simply no exports at all. Only module declarations. So, this makes it impossible to use NuxtAxios types anywhere in your app?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7

github_iconTop GitHub Comments

17reactions
silverbackdancommented, Mar 10, 2022

Please see https://github.com/nuxt-community/axios-module/issues/555

Seems to work with import type instead of just import 😃

0reactions
eerisoncommented, Nov 21, 2021

same here! it’s happen after I use nuxtjs 3 bridge

In my case I wasn’t using ‘#app’ after I change the import it back to work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nuxt/TypeScript: Cannot access this - TS2339: Property 'XXX ...
I find it strange this isn't referenced in the docs. The shown example with this.$axios does not work out of the box. Anyway,...
Read more >
Store - Nuxt TypeScript
import { NuxtAxiosInstance } from '@nuxtjs/axios' let $axios: ... It has just released a new API, although it is not yet compatible in...
Read more >
error after running v0.15 | Quasar Framework Community
Hi I need help with the newest version when I command quasar dev and i encountered this error. X:\some\directories\client\src\pages\404.vue ...
Read more >
@nuxtjs/axios | Yarn - Package Manager
Important: This documentation covers modern versions of Yarn. For 1.x docs, see classic.yarnpkg.com. Yarn.
Read more >
Getting Started With Axios In Nuxt - Smashing Magazine
This way, we do not have to hard code our API into our app which is useful for working with two APIs (development...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found