Skip to content

strictTemplates error on id #5420

Open
Open
@phil294

Description

@phil294

Vue - Official extension or vue-tsc version

2.2.10

VSCode version

Vue version

3.5.16

TypeScript version

5.8.3

System Info

(from stackblitz)

  System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 20.19.1 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.8.2 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm

package.json dependencies

"devDependencies": {
    "@vitejs/plugin-vue": "^5.2.4",
    "typescript": "^5.8.3",
    "vite": "^6.3.5",
    "vue-tsc": "^2.2.10"
  },
  "dependencies": {
    "vue": "^3.5.16"
  }

Steps to reproduce

  • checkJs: true, strictTemplates, project files WITHOUT lang="ts"
  • use a component and pass id="something"

or easier, click here:

What is expected?

no error

What is actually happening?


❯ npx vue-tsc
src/App.vue:9:32 - error TS2353: Object literal may only specify known properties, and 'id' does not exist in type 'Partial<{}> & Omit<{} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never> & { ...; }'.

9   <HelloWorld msg="my message" id="id" />

Found 1 error in src/App.vue:9

Link to minimal reproduction

https://stackblitz.com/edit/vitejs-vite-ufwfehfe?file=src%2FApp.vue

Any additional comments?

This is a copy-paste of the stackblitz from #3443 which was fixed, but only for lang="ts" components. Without it, but still with strict type checking, the error remains.

Also applies to aria-role= and probably many other attrs

Metadata

Metadata

Assignees

No one assigned

    Labels

    good reproduction ✨This issue provides a good reproduction, we will be able to investigate it firstupstream: core

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions