-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
Description
Describe the bug
When running Vitest with the --coverage option, a runtime error is thrown when using Vue v-model bindings on Web Components.
Expected behavior:
- Using v-model on Web Components should not throw an error when running tests with coverage enabled.
Reproduction
This happens in a Vue project configured with the Vite Vue plugin, where custom elements are declared using compilerOptions.isCustomElement.
The issue occurs regardless of the coverage provider:
-
coverage.provider = "istanbul"
-
coverage.provider = "v8"
-
vite configuration
vue({
template: {
compilerOptions: {
isCustomElement: (tag) => tag.startsWith('ux-'),
},
},
})
- console error :
SyntaxError: v-model can only be used on <input>, <textarea> and <select> elements.
38 | <ux-XXX
39 | v-model="model"
| ^
System Info
System:
OS: Linux 6.14 Ubuntu 24.04.3 LTS 24.04.3 LTS (Noble Numbat)
CPU: (6) x64 AMD Ryzen 5 4500U with Radeon Graphics
Memory: 22.69 GB / 30.76 GB
Container: Yes
Shell: 5.9 - /usr/bin/zsh
Binaries:
Node: 22.21.0 - .nvm/versions/node/v22.21.0/bin/node
npm: 10.9.4 - .nvm/versions/node/v22.21.0/bin/npm
pnpm: 10.19.0 - .nvm/versions/node/v22.21.0/bin/pnpm
Browsers:
Chrome: 143.0.7499.40
npmPackages:
@vitejs/plugin-vue: ^6.0.2 => 6.0.2
@vitest/coverage-istanbul: ^4.0.15 => 4.0.15
vite: ^7.2.7 => 7.2.7
vitest: ^4.0.15 => 4.0.15Used Package Manager
npm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
avnk45 and nbitaud