Skip to content

Incorrect TS issues being reported after upgrade to 2.2.6 #5227

@richmason

Description

@richmason

Vue - Official extension or vue-tsc version

2.2.6

VSCode version

1.97.2

Vue version

3.5.13

TypeScript version

5.7.3

System Info

package.json dependencies

Steps to reproduce

Create a SFC with a v-model that accepts different types, such as:

const model = defineModel<string | number>({
    required: true,
});

Then use the component:

const testValue = ref("Hello, World")
<MyComponent v-model="testValue" />

What is expected?

Given the following is valid TS:

let test:string | number = "test"
test = 8;

There should be no TypeScript errors.

What is actually happening?

The following error is being displayed in VSCode:

Type 'string | number' is not assignable to type 'string'.
  Type 'number' is not assignable to type 'string'. ts-plugin(2322)

Link to minimal reproduction

https://github.com/richmason/vue-ts-issue

Any additional comments?

This was not an issue in version 2.2.4

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions