Closed szulcus closed 6 months ago
I can't reproduce it from playground
For context, I use Nuxt Layers and @pinia/nuxt module.
@pinia/nuxt
nuxt.config.ts
export default defineNuxtConfig({ // ... imports: { dirs: ['stores', 'node_modules/@frontend/nuxt-layer-base/stores'], }, });
const f24BaseStore = useF24BaseStore();
console.log(f24BaseStore.toasts);
{ value: ...; [RefSymbol]: true; }
In local stores all works fine. For woraround I have this in index.d.ts:
index.d.ts
import { UnwrapRef } from 'vue'; // import { _UnwrapAll } from 'pinia'; export {}; type _UnwrapAll<SS> = { [K in keyof SS]: UnwrapRef<SS[K]>; }; declare global { const useF24BaseStore: () => _UnwrapAll<ReturnType<(typeof import('@frontend/nuxt-layer-base/stores/base'))['useF24BaseStore']>>; }
You need to ensure they all import from the same Vue package. Make sure pinia and vue are externalized
Reproduction
I can't reproduce it from playground
Steps to reproduce the bug
For context, I use Nuxt Layers and
@pinia/nuxt
module.nuxt.config.ts
:{ value: ...; [RefSymbol]: true; }
)Expected behavior
Actual behavior
Additional information
In local stores all works fine. For woraround I have this in
index.d.ts
: