defineModel with default function accessing destructured prop causes [PARSE_ERROR] Expected `,` or `)` but found `Identifier`
Author: kleinfreundCreated Sep 22, 2026Updated Sep 24, 2026
Labelsscope: sfc:hammer: p3-minor-bug
Vue version
3.5.43
Link to minimal reproduction
https://stackblitz.com/edit/vitejs-vite-qz8mzlh4?file=src%2FApp.vue
Steps to reproduce
- Run any command that would transform App.vue with
@vitejs/plugin-vue(likevite).
Note, that the reproduction is currently broken due to a stackblitz issue seemingly caused by https://github.com/rolldown/rolldown/issues/10938.
<template>
<input v-model="model" />
</template>
<script setup lang="ts">
const { defaultValue = '' } = defineProps<{ defaultValue?: string }>();
const model = defineModel<string>({
default: () => defaultValue,
// Intentionally avoiding the `props` parameter of the default function as it's not properly typed.
// default: (props) => props.defaultValue,
});
</script>What is expected?
No error occurs.
What is actually happening?
The following error occurs:
[PARSE_ERROR] Expected `,` or `)` but found `Identifier`
╭─[ src/App.vue:34:54 ]
│
34 │ const model = _useModel<string>(__props, "modelValue"__props.defaultValue);
│ ┬ ───┬───
│ ╰────────────────────────────── Opened here
│ │
│ ╰───── `,` or `)` expected
────╯
Plugin: vite:vueSystem Info
Any additional comments?
- I'm deliberately not using the
propsparameter passed to the model'sdefaultfunction as it isn't typed properly (well, it's typed asRecord<string, unknown>but doesn't infer/use the prop interface type, see https://github.com/vuejs/rfcs/discussions/836). Also, if I were to use it, I'd now need to ignore the@typescript-eslint/no-unused-varserror on the destructured prop that isn't used elsewhere
Source: vuejs/core