Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[vue-tsc] Generic Props gets Inferred as unknown #5592

Copy link
Copy link
@unrevised6419

Description

@unrevised6419
Issue body actions

Vue - Official extension or vue-tsc version

3.0.5

VSCode version

1.102.3

Vue version

3.5.18

TypeScript version

5.8.0

System Info

System:
    OS: macOS 26.0
    CPU: (8) arm64 Apple M1
    Memory: 267.22 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.15.0 - ~/.nvm/versions/node/v22.15.0/bin/node
    Yarn: 2.4.3 - ~/.nvm/versions/node/v22.15.0/bin/yarn
    npm: 11.3.0 - ~/.nvm/versions/node/v22.15.0/bin/npm
    pnpm: 9.15.9 - ~/.nvm/versions/node/v22.15.0/bin/pnpm
  Browsers:
    Brave Browser: 138.1.80.125
    Chrome: 138.0.7204.184
    Safari: 26.0

package.json dependencies

{
  "dependencies": {
    "vue": "^3.5.18"
  },
  "devDependencies": {
    "@tsconfig/node22": "^22.0.1",
    "@types/node": "^22.14.0",
    "@vitejs/plugin-vue": "^5.2.3",
    "@vue/tsconfig": "^0.7.0",
    "npm-run-all2": "^7.0.2",
    "typescript": "~5.8.0",
    "vite": "^6.2.4",
    "vite-plugin-vue-devtools": "^7.7.2",
    "vue-tsc": "^3.0.5"
  }
}

Steps to reproduce

Having this component

LocalScope.vue

<script setup lang="ts" generic="T">
defineOptions({ inheritAttrs: false });
defineProps</* @vue-ignore */ T>();
</script>

<template>
	<slot v-bind="$attrs as T" />
</template>

And this usage

<script setup lang="ts">
import LocalScope from './LocalScope.vue';
</script>

<template>
  <LocalScope #default="{ foo, bar }" :foo="42" bar="baz">
    {{ foo }} {{ bar }}
  </LocalScope>
</template>

With vue-tsc@3, running npx vue-tsc --build, we have such results

src/App.vue:6:27 - error TS2339: Property 'foo' does not exist on type 'unknown'.

6   <LocalScope #default="{ foo, bar }" :foo="42" bar="baz">
                            ~~~

src/App.vue:6:32 - error TS2339: Property 'bar' does not exist on type 'unknown'.

6   <LocalScope #default="{ foo, bar }" :foo="42" bar="baz">
                                 ~~~


Found 2 errors.

What is expected?

With vue-tsc@2, running npx vue-tsc --build, we no errors

What is actually happening?

With vue-tsc@3, running npx vue-tsc --build, we have such results

src/App.vue:6:27 - error TS2339: Property 'foo' does not exist on type 'unknown'.

6   <LocalScope #default="{ foo, bar }" :foo="42" bar="baz">
                            ~~~

src/App.vue:6:32 - error TS2339: Property 'bar' does not exist on type 'unknown'.

6   <LocalScope #default="{ foo, bar }" :foo="42" bar="baz">
                                 ~~~


Found 2 errors.

Link to minimal reproduction

https://github.com/unrevised6419/issue-vue-tsc-3

Any additional comments?

This happens with Vue extension v3 also. Downgrading to v2, works fine.

vuejs/rfcs#505 (comment)

2025-08-07.19-16-47.mov
eric-gitta-moore and mitareric-gitta-moore

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.