I have a template ref with type Ref<ComponentPublicInstance | null> for accessing $refs. It works fine on runtime.
However, I get TypeError on building the app:
src/core/views/TopBar/TagBar.vue:17:27 - error TS2551: Property 'refs' does not exist on type 'ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>'. Did you mean '$refs'?
17 () => scrollbar.value?.$refs?.wrap as HTMLDivElement | undefined
~~~~
node_modules/@vue/runtime-core/dist/runtime-core.d.ts:437:5
437 $refs: Data;
~~~~~
'$refs' is declared here.
Found 1 error.
I have a template ref with type
Ref<ComponentPublicInstance | null>
for accessing$refs
. It works fine on runtime. However, I get TypeError on building the app:Here is my original code in
<script setup>