WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Typescript error when using slot props with v-else #5850

@sgerke-1L

Description

@sgerke-1L

Vue - Official extension or vue-tsc version

3.1.8

VSCode version

1.105.1

Vue version

3.5.25

TypeScript version

5.9.3

System Info

System:
    OS: Linux 6.17 Ubuntu 25.10 25.10 (Questing Quokka)
    CPU: (14) x64 Intel(R) Core(TM) i7-14700HX
    Memory: 10.17 GB / 20.97 GB
    Container: Yes
    Shell: 5.2.37 - /bin/bash
  Binaries:
    Node: 24.10.0 - /home/s/.nvm/versions/node/v24.10.0/bin/node
    npm: 11.6.4 - /home/s/.nvm/versions/node/v24.10.0/bin/npm
  Browsers:
    Chrome: 143.0.7499.40

package.json dependencies

Steps to reproduce

Take a look at reproducer.zip for a minimal example. The following produces a type error in the v-else line:

reproducer.zip

  <Comp>
    <template v-if="flag" #default="{message, count}">{{ message }} {{ count }}    </template>
    <template v-else #default="{message, count}">{{ message }} {{ count + 1 }}    </template>
  </Comp>

What is expected?

This has been working with language-tools 3.1.5

What is actually happening?

src/App.vue:10:55 - error TS2339: Property 'message' does not exist on type '{ flag: true; $: ComponentInternalInstance; $data: {}; $props: {}; $attrs: Data; $refs: Data; $slots: Readonly<InternalSlots>; ... 8 more ...; $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R, args_2: OnCleanup) => any : (args_0: any, args_...'.

10     <template v-else #default="{ message, count }">{{ message }} {{ count }} </template>
                                                         ~~~~~~~

Link to minimal reproduction

No response

Any additional comments?

reproducer.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already existsgood reproduction ✨This issue provides a good reproduction, we will be able to investigate it first

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions