Skip to content

Type checking fails for components loaded via defineAsyncComponent #4789

Closed
@BlushingTomato

Description

@BlushingTomato

Vue - Official extension or vue-tsc version

2.1.4

VSCode version

1.92.2

Vue version

2.7.16

TypeScript version

5.5.4

System Info

No response

package.json dependencies

No response

Steps to reproduce

  • Import a component via const Component = defineAsyncComponent(() => import('path/to/Component.vue')) and use it within the template.
  • Run vue-tsc --noEmit
  • Notice the error.

What is expected?

The check passing succesfully.

What is actually happening?

The following TS error:

TS2345: Argument of type '{}' is not assignable to parameter of type '(component: Component<DefaultData<never>, DefaultMethods<never>, DefaultComputed, DefaultProps, {}>) => void'.
  Type '{}' provides no match for the signature '(component: Component<DefaultData<never>, DefaultMethods<never>, DefaultComputed, DefaultProps, {}>): void'.

Link to minimal reproduction

No response

Any additional comments?

This issue started happening in 2.1.4, 2.1.2 seems to work fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good 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