Skip to content

Built-in v-model modifiers produce type errors with v3.1.2 #4166

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Anton-Plagemann opened this issue May 16, 2025 · 1 comment · Fixed by #4195
Closed

Built-in v-model modifiers produce type errors with v3.1.2 #4166

Anton-Plagemann opened this issue May 16, 2025 · 1 comment · Fixed by #4195
Assignees
Labels
bug Something isn't working v3 #1289

Comments

@Anton-Plagemann
Copy link

Environment

Is this bug related to Nuxt or Vue?

Nuxt

Version

v3.1.2

Reproduction

https://codesandbox.io/p/devbox/sharp-christian-kzdxt9?file=%2Fapp%2Fpages%2Findex.vue

Description

Starting from v3.1.2, using the built-in v-model-modifiers produces type errors. They are still working tho, so its only a type issue.

Reproduction:

  1. Open provided link
  2. Run pnpx nuxi typecheck

Additional context

No response

Logs

➜  workspace git:(master) ✗ pnpx nuxi typecheck
Packages: +1
+
Progress: resolved 1, reused 1, downloaded 0, added 1, done
ℹ Nuxt Icon server bundle mode is set to local                                                                                                                                                        11:09:23 AM
✔ Nuxt Icon discovered local-installed 2 collections: lucide, simple-icons                                                                                                                            11:09:25 AM
ℹ Running with compatibility version 4                                                                                                                                                           nuxt 11:09:25 AM
app/pages/index.vue:8:22 - error TS2353: Object literal may only specify known properties, and 'modelModifiers' does not exist in type '{ readonly onBlur?: ((event: FocusEvent) => any) | undefined; readonly onChange?: ((event: Event) => any) | undefined; readonly "onUpdate:modelValue"?: ((payload: number) => any) | undefined; ... 24 more ...; modelValue?: number | undefined; } & VNodeProps & AllowedComponentProps & ComponentCustomProps'.

8       <UInput v-model.number="myNumber" type="number" />
                       ~~~~~~~

app/pages/index.vue:9:22 - error TS2353: Object literal may only specify known properties, and 'modelModifiers' does not exist in type '{ readonly onBlur?: ((event: FocusEvent) => any) | undefined; readonly onChange?: ((event: Event) => any) | undefined; readonly "onUpdate:modelValue"?: ((payload: string) => any) | undefined; ... 24 more ...; modelValue?: string | undefined; } & VNodeProps & AllowedComponentProps & ComponentCustomProps'.

9       <UInput v-model.lazy="myText" />
                       ~~~~~


Found 2 errors in the same file, starting at: app/pages/index.vue:8


 ERROR  Process exited with non-zero status (2)                                                                                                                                                        11:09:41 AM

    at R._waitForOutput (/root/.cache/pnpm/v3/tmp/dlx-4483/node_modules/.pnpm/[email protected]/node_modules/nuxi/dist/chunks/main.mjs:508:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.run (/root/.cache/pnpm/v3/tmp/dlx-4483/node_modules/.pnpm/[email protected]/node_modules/nuxi/dist/chunks/typecheck.mjs:91:9)
    at async runCommand$1 (/root/.cache/pnpm/v3/tmp/dlx-4483/node_modules/.pnpm/[email protected]/node_modules/nuxi/dist/shared/nuxi.BlFGnQYG.mjs:1767:16)
    at async runCommand$1 (/root/.cache/pnpm/v3/tmp/dlx-4483/node_modules/.pnpm/[email protected]/node_modules/nuxi/dist/shared/nuxi.BlFGnQYG.mjs:1758:11)
    at async runMain$1 (/root/.cache/pnpm/v3/tmp/dlx-4483/node_modules/.pnpm/[email protected]/node_modules/nuxi/dist/shared/nuxi.BlFGnQYG.mjs:1896:7) 



 ERROR  Process exited with non-zero status (2)
@Anton-Plagemann Anton-Plagemann added bug Something isn't working v3 #1289 triage labels May 16, 2025
@benjamincanac
Copy link
Member

@HugoRCD Possible regression of 3c8d6cd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v3 #1289
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants