Skip to content

Slot scopes defined in defineSlots that begin with aria fail type check #6084

Description

@VividLemon

Vue - Official extension or vue-tsc version

3.3.3

VSCode version

na

Vue version

3.5.35

TypeScript version

6.0.3

System Info

System:
    OS: Linux 6.18 Pop!_OS 24.04 LTS
    CPU: (16) x64 AMD Ryzen 7 7800X3D 8-Core Processor
    Memory: 16.96 GB / 30.50 GB
    Container: Yes
    Shell: 5.2.21 - /bin/bash
  Binaries:
    Node: 24.13.0 - /home/issayah/.nvm/versions/node/v24.13.0/bin/node
    Yarn: 1.22.22 - /home/issayah/.nvm/versions/node/v24.13.0/bin/yarn
    npm: 11.6.2 - /home/issayah/.nvm/versions/node/v24.13.0/bin/npm
    pnpm: 10.30.1 - /home/issayah/.nvm/versions/node/v24.13.0/bin/pnpm
    bun: 1.3.14 - /home/issayah/.bun/bin/bun

package.json dependencies

"dependencies": {
    "vue": "^3.5.35"
  },
  "devDependencies": {
    "@tsconfig/node24": "^24.0.4",
    "@types/node": "^24.12.4",
    "@vitejs/plugin-vue": "^6.0.7",
    "@vue/tsconfig": "^0.9.1",
    "npm-run-all2": "^8.0.4",
    "typescript": "~6.0.3",
    "vite": "^8.0.16",
    "vite-plugin-vue-devtools": "^8.1.2",
    "vue-tsc": "^3.3.3"
  },

Steps to reproduce

<script setup lang="ts">
defineSlots<{
  default(props: { msgBy: string; ariaaDescribedby: string; ariaDescribedby: string }): any
}>()

</script>

<template>
  <div class="greetings">
    <slot msg-by="foo" ariaa-describedby="foo" aria-describedby="bar" />
  </div>
</template>

What is expected?

It seems that any aria beginning slot name fails. I tested the same code, but with aria-expanded as well, not others. But when I do that above code, it will fail telling me the object literal may only specify known properties.

It works if I properly use ariaDescribedby in the template, but automatic linting rules from vue recommended will convert it to hyphens.

What is actually happening?


src/components/HelloWorld.vue:10:48 - error TS2353: Object literal may only specify known properties, and ''aria-describedby'' does not exist in type '{ msgBy: string; ariaaDescribedby: string; ariaDescribedby: string; }'.

10     <slot msg-by="foo" ariaa-describedby="foo" aria-describedby="bar" />

Link to minimal reproduction

No response

Any additional comments?

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    good reproduction ✨This issue provides a good reproduction, we will be able to investigate it first🔩 p2-edge-case

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions