Skip to content

Can't resolve modelModifiers when using a generic modelValue #5482

Open
@MiniDigger

Description

@MiniDigger

Vue - Official extension or vue-tsc version

3.0.1

VSCode version

not applicable

Vue version

3.5.17

TypeScript version

5.8.3

System Info

StackBlitz: System: OS: Linux 5.0 undefined CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Memory: 0 Bytes / 0 Bytes Shell: 1.0 - /bin/jsh Binaries: Node: 20.19.1 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 10.8.2 - /usr/local/bin/npm pnpm: 8.15.6 - /usr/local/bin/pnpm

package.json dependencies

"dependencies": { "typescript": "5.8.3", "vue": "3.5.17", "vue-tsc": "3.0.1" }, "devDependencies": { "@vitejs/plugin-vue": "6.0.0", "vite": "7.0.2" }

Steps to reproduce

create a component with a generic defineModel (or specify a modelValue prop as generic).
use that component with a model modifier.

(or open the repro and run npm run typecheck)

What is expected?

no error.

What is actually happening?

src/App.vue(11,27): error TS2353: Object literal may only specify known properties, and 'modelModifiers' does not exist in type '{ readonly "onUpdate:modelValue"?: (value: string) => any; modelValue?: string; } & VNodeProps & AllowedComponentProps & ComponentCustomProps'.

Link to minimal reproduction

https://stackblitz.com/edit/vitejs-vite-jh5tawmk?file=error.txt

Any additional comments?

its not caused by 3.x, downgraded to 2.2.12 and observed the same.
edit: actually, its a regression from 2.1.10 -> 2.2.0
edit2: oh that was when generics where added, so prolly not relevant

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions