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
System:
OS: Linux 5.15 Linux Mint 21.3 (Virginia)
CPU: (6) x64 Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
Memory: 5.38 GB / 10.67 GB
Container: Yes
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 22.15.0 - ~/apps/node/bin/node
npm: 11.4.0 - ~/apps/node/bin/npm
Steps to reproduce
Create this child component:
<script setup lang="ts">
const props =defineProps<{ name:string;}>();
</script>
<template>
<h2>This is the component</h2>
<div>{{props.name}}</div>
</template>
And the hosting component:
<script setup lang="ts">
import {ref} from'vue';importComponentfrom'./Component.vue';// --- This works ---const theName =ref('foo');// --- This doesn't work ---function useFoo() {const name =ref('foo');return {name};}const foo =useFoo();
</script>
<template>
<Component:name="theName" />
<Component:name="foo.name" /> <!-- error here -->
</template>
What is expected?
No errors.
What is actually happening?
The extension is showing an error, asking me to use .value if the ref comes from a composable. If the ref was declared in the script setup block – that is, not coming from a composable –, the error doesn't show.
Any additional comments?
This error happens in v3.0.0-alpha.6 (#5261), it seems that it cannot recognize a ref coming from a composable. If the ref is declared within the script setup block, it is parsed correctly.
I attached a project with the minimal reproduction scenario:
Uh oh!
There was an error while loading. Please reload this page.
Vue - Official extension or vue-tsc version
Extension v3.0.0-alpha6 ; vue-tsc 2.2.10
VSCode version
1.100.2
Vue version
3.5.14
TypeScript version
5.8.3
System Info
Steps to reproduce
Create this child component:
And the hosting component:
What is expected?
No errors.
What is actually happening?
The extension is showing an error, asking me to use
.value
if theref
comes from a composable. If theref
was declared in thescript setup
block – that is, not coming from a composable –, the error doesn't show.Any additional comments?
This error happens in v3.0.0-alpha.6 (#5261), it seems that it cannot recognize a
ref
coming from a composable. If theref
is declared within thescript setup
block, it is parsed correctly.I attached a project with the minimal reproduction scenario:
composable-bug.zip
The text was updated successfully, but these errors were encountered: