Skip to content

SFC setup script does not make imported components available to template with TypeScript + Pug #4312

Closed
@spenserblack

Description

@spenserblack

Version

3.2.2

Reproduction link

https://github.com/spenserblack/setup-script-typescript-and-pug-issue

Steps to reproduce

  1. Create an SFC with <template lang="pug"> and <script setup lang="ts">
  2. Import a component
  3. Use component in template

What is expected?

Imported component is rendered.

What is actually happening?

Imported component is not rendered, receive warning

[Vue warn]: Invalid vnode type when creating vnode: undefined

This seems to happen specifically when TypeScript and Pug are used together. As you can see in the reproduction, when <template> <script setup lang="ts">, component renders, and when <template lang="pug"> <script setup>, component renders. Only <template lang="pug"> <script setup lang="ts"> seems to cause the issue.

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