You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No idea why I'm getting this error from deep inside the library
ERROR in /Users/blackmad/Dropbox/Code/mixlet/node_modules/vuex-typescript-interface/vue.d.ts
13:5 Subsequent property declarations must have the same type. Property 'store' must be of type 'Store<any>', but here has type 'Store<any>'.
11 | interface ComponentOptions<V extends Vue>
12 | {
> 13 | store?: Store<any>;
| ^
14 | }
15 |
16 | }
I would remove the dependency for vuex and just use vuex-typescript-interface. The vuex types interfere. This library supplies the vuex functionality but with better type support.
While your workaround works for projects where vuex has been installed directly as a dependency, it does not work for e. g. nuxt.js which depends on vuex itself.
The problem with Nuxt is that stores are not created directly but by convention. Every .js/.ts file inside the store directory is transformed as a namespaced module (index being the root module) (see: Vuex Store - Nuxt.js).
Therefore there is no real store initialisation written by the user. Your definition of vue.d.ts collides with Vuex's vue.d.ts which is required by Nuxt.js.
My only workaround for the moment was to fork your project and exclude the vue.d.ts, loosing the possibility to use the type store easily.
No idea why I'm getting this error from deep inside the library
my store.ts looks like this
The text was updated successfully, but these errors were encountered: