types: `true-value`/`false-value` on <input> and `xmlns:xlink`/`xlink:href` on <svg> rejected as unknown attributes in templates
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 3/5
- Estimated time
- Half a day
- Newbie friendliness
- 15/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- frontend
Research direction
The errors come from the JSX attribute types InputHTMLAttributes and SVGAttributes in @vue/runtime-dom, so look there first. Check how vModelCheckbox reads true-value and false-value, and compare the camelCase xmlnsXlink and xlinkHref keys with the namespaced spellings a template uses. Linked PR #16247 is already open against this, so review or extend that work instead of starting a new change. Done means the template in the report type-checks with no unknown-attribute errors.
Written by the indexing model from the issue text.
Description
Versions
vue3.5.44 (@vue/runtime-domJSX types)vue-tsc3.3.13 +typescript6.0.3 withstrictTemplates: true; same with@vue/content-mapper4.0.0-alpha.3 +typescript7.1.0-beta, where unknown attributes are always checked
Reproduction
<script setup lang="ts">
import { ref } from 'vue'
const checked = ref<'yes' | 'no'>('no')
</script>
<template>
<input v-model="checked" type="checkbox" true-value="yes" false-value="no" />
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 10 10">
<use xlink:href="#a" />
</svg>
</template>
Actual
error TS2353: Object literal may only specify known properties, and ''true-value'' does not exist in type 'InputHTMLAttributes & ReservedProps'.
error TS2353: Object literal may only specify known properties, and ''xmlns:xlink'' does not exist in type 'SVGAttributes & ReservedProps'.
error TS2353: Object literal may only specify known properties, and ''xlink:href'' does not exist in type 'SVGAttributes & ReservedProps'.
Expected
No errors:
true-value/false-valueare Vue's own checkboxv-modelattributes (vModelCheckboxreads them), soInputHTMLAttributescould declare them (typedany, likevalue).xmlns:xlinkandxlink:hrefare valid SVG attributes.SVGAttributesdeclares them only in camelCase (xmlnsXlink,xlinkHref), but a template writes the namespaced spelling, and a name with:is not camelized, so it never matches.
#9299 reported the xmlns:xlink case and is closed as completed (presumably via xmlnsXlink), but the template spelling is still rejected in 3.5.44. Declaring the namespaced keys too ('xmlns:xlink'?, 'xlink:href'?...) would cover it; if the template-side mapping should handle this instead, feel free to move it to language-tools.
This matters more now that the content mapper (language-tools v4) always reports unknown attributes; with vue-tsc 3 only strictTemplates/checkUnknownProps users saw it.
- Dominant language
- TypeScript
- Stars
- 55k
- Forks
- 9.3k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 194
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from vuejs/core
-
Native event listener types should allow a promise return typePossibly taken @willnie9 claimed this today. Openscope: types
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
watchEffect typing does not support async callbackPossibly taken @zhanghaifeng213 claimed this 327 days ago. Openscope: types
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vuejs/core#14249 · 4 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
[@vue/reactivity] watch() doesn't accept TS genericsPossibly taken @alex-snezhko claimed this 442 days ago. Openscope: types
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
vuejs/core#13807 · 3 reactions ·
Maintainers usually reply within 1 day
-
Invalid HTML with `TransitionGroup name="list" tag="ul"`Possibly taken @ZKunZhang claimed this 429 days ago. Open🔩 p2-edge-case scope: ssr
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
vuejs/core#13037 · 8 comments ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 1-2 days Newbie friendliness 50/100
Maintainers usually reply within 1 day
Similar issues
-
bot:ai-assisted component:platform-js status:untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
midnightntwrk/platform-js#69 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Picolab/pico-engine#668 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
ai-driven-qa bug claude Cosmetic
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
needs verification
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 13 days