Open a-kriya opened 3 years ago
I have same error. "direct-vuex": "0.10.4"
@viT-1 I had to downgrade to TS 3.8.3. Upgrading to Vue3 may also solve the issue.
@paleo Unlikely that the issue can be resolved in this package, but I thought filing this ticket may help others.
Hi. I suggest you edit node_modules/direct-vuex/types/direct-types.d.ts
. Line 24, change the type of original
to any
. If it works, I can consider to publish the package with this workaround. I think the type of original
is not really important in our case.
export type ToDirectStore<O extends StoreOptions> = ShowContent<{
readonly state: ShowContent<DirectState<O>>
getters: ShowContent<DirectGetters<O>>
commit: ShowContent<DirectMutations<O>>
dispatch: ShowContent<DirectActions<O>>
original: any // <-- here, replace 'VuexStore<O>' by 'any'
}>
@paleo Thanks for the suggestion. That fixes the error.
@paleo Do you think it's something you'll want to include and publish?
I'll share my header.spec.ts file that tries to mock a getter and encounters
ts(2615)
onstore.original
:The Header component itself is fairly straightforward: main store is imported and an
isAuthenticated
computed property is defined that returns the value from the imported store.Is the above issue related to this package, or caused due to other packages/configuration in my project? Any help is appreciated.