types: `true-value`/`false-value` on <input> and `xmlns:xlink`/`xlink:href` on <svg> rejected as unknown attributes in templates

Open
#16,246 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@bunnysayzz is already working on this.

Since Nov 12, 2026.

  • #16247 by @bunnysayzz — open

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

scope: types

Versions

  • vue 3.5.44 (@vue/runtime-dom JSX types)
  • vue-tsc 3.3.13 + typescript 6.0.3 with strictTemplates: true; same with @vue/content-mapper 4.0.0-alpha.3 + typescript 7.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-value are Vue's own checkbox v-model attributes (vModelCheckbox reads them), so InputHTMLAttributes could declare them (typed any, like value).
  • xmlns:xlink and xlink:href are valid SVG attributes. SVGAttributes declares 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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from vuejs/core

All issues in vuejs/core

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.