Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

vue-tsc v0.1.5 regression with <component> #34

Closed
cexbrayat opened this issue May 24, 2021 · 1 comment
Closed

vue-tsc v0.1.5 regression with <component> #34

cexbrayat opened this issue May 24, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@cexbrayat
Copy link

When using:

  <RouterView v-slot="{ Component }">
    <component :is="Component" />
  </RouterView>

with:

declare module '@vue/runtime-core' {
  interface GlobalComponents {
    RouterLink: typeof RouterLink & {
      __VLS_slots: {
        default: UnwrapRef<ReturnType<typeof useLink>>;
      };
    };
    RouterView: typeof RouterView & {
      __VLS_slots: {
        default: {
          Component: VNode;
          route: RouteLocationNormalized & { href: string };
        };
      };
    };
  }
}

then vue-tsc works perfectly in v0.1.4 but started failing in v0.1.5 with:

$ vue-tsc --noEmit
src/components/HelloWorld.vue:3:6 - error TS2345: Argument of type '{ is: VNode<RendererNode, RendererElement, { [key: string]: any; }>; }' is not assignable to parameter of type '{ is: VNode<RendererNode, RendererElement, { [key: string]: any; }>; } & VNode<RendererNode, RendererElement, { ...; }>'.
  Type '{ is: VNode<RendererNode, RendererElement, { [key: string]: any; }>; }' is missing the following properties from type 'VNode<RendererNode, RendererElement, { [key: string]: any; }>': type, props, key, ref, and 19 more.

3     <component :is="Component" />
       ~~~~~~~~~

This happened on all our Vue 3 projects when bumping to v0.1.5.
I made a small repro if that helps cexbrayat/vue-cli-playground#10

Thank you for your work on volar @johnsoncodehk !

@johnsoncodehk johnsoncodehk changed the title vue-tsc v1.0.5 regression with <component> vue-tsc v0.1.5 regression with <component> May 24, 2021
@johnsoncodehk johnsoncodehk added the bug Something isn't working label May 24, 2021
@johnsoncodehk
Copy link
Owner

Fixed 0.1.6, thanks for your report!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants