Skip to content

TypeError: When using template around template slot #11521

Open
@Disservin

Description

@Disservin

Vue version

3.4.35

Link to minimal reproduction

https://play.vuejs.org/#eNqFkk1PwzAMhv9KFA4DabRChcvoQIB2gAMgxjESqlp3ZLRJlY8yaep/x0k/VqQybonfx4n92nt6V1VBbYEuaKxTxStDNBhb3TDBy0oqQx5kWV2QXMmSzILQ31zC7JqJOGxTEMaLgbIqEgN4IyT2YHtsk/AchwND59ToVIqcb4KtlgL/3zuY0RRhXoB6qQyXQjO6IF5xWlIU8vvJx4yyMO/j6SekXxPxrd65GKOvCjSoGhgdNJOoDZhWXq2fYYfnQSxlZgukj4hvoGVhXY0tdm9FhmWPOF/to3eRi827Xu0MCN035Qp1ZON5RtFT59NfrR/KjYLI5zHRoIsuZ3KAx4aT8dof8KgLaYhISlgyypFi1GVisJtdi44mx0T3q1+D43vza236ren0PbEa1viRJk3HdQATuBgaH/TicuBOz/5fub6tXiH1Oc+xNf/WbZBBntgCbey4MXni2h/ivTXhgRx7MBFo93zCrI8alBs7ehUFl0F0RZsfhdgklw==

Steps to reproduce

Add another template around the template slot

<template>
  <Comp>
      <template #item>
        <slot />
      </template>
  </Comp>
</template>

so that it looks like this

<template>
  <Comp>
    <template v-if="slots?.default">
      <template #item>
        <slot />
      </template>
    </template>
  </Comp>
</template>
TypeError: Cannot read properties of undefined (reading 'type')

What is expected?

No type error, or an error saying that this syntax isn't support (i'm not sure if this is actually supposed to work?)

What is actually happening?

TypeError: Cannot read properties of undefined (reading 'type')
    at getMemoedVNodeCall (compiler-sfc.esm-browser.js:17146:12)
    at createChildrenCodegenNode (compiler-sfc.esm-browser.js:22946:23)
    at createCodegenNodeForBranch (compiler-sfc.esm-browser.js:22892:7)
    at Array.<anonymous> (compiler-sfc.esm-browser.js:22782:32)
    at traverseNode (compiler-sfc.esm-browser.js:18413:15)
    at traverseChildren (compiler-sfc.esm-browser.js:18365:5)
    at traverseNode (compiler-sfc.esm-browser.js:18407:7)
    at transform (compiler-sfc.esm-browser.js:18302:3)

System Info

No response

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions