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

"Property 'get' does not exist on type 'Action<IRootState, IRootState>'." when using `this.$axios` in store action #240

Open sambowler opened 5 years ago

sambowler commented 5 years ago

Version

v5.1.0

Reproduction link

https://codesandbox.io/s/14zzr032xj

Steps to reproduce

I might just be missing some configuration but I'm unable to get my store to properly pick up the types for this.$axios in Vuex store actions. Things I've tried:

This is all using the actions type definition found in the Nuxt example here: https://nuxtjs.org/examples/typescript-vuex (and in use in the codesandbox link provided -- see store/index.ts).

If I remove that, I get a "Property '$axios' does not exist on type" error instead.

What is expected ?

Types are picked up correctly and I'm able to use this.$axios methods.

What is actually happening?

Types are not correctly picked up and builds subsequently fail.

This bug report is available on Nuxt community (#c234)
ghost commented 4 years ago

same problem here.

jeffpohlmeyer commented 3 years ago

I'm going to go ahead and bump this with the hopes that someone sees it.

farnabaz commented 3 years ago

As I tested, it works fine with latest release.