Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$scopedSlots error with latest version of Vue and Typescript #18

Closed
RnbWd opened this issue Dec 17, 2018 · 3 comments
Closed

$scopedSlots error with latest version of Vue and Typescript #18

RnbWd opened this issue Dec 17, 2018 · 3 comments

Comments

@RnbWd
Copy link

RnbWd commented Dec 17, 2018

I'm getting this error:

 Property '$scopedSlots' in type 'Component<Props, EventsWithOn, ScopedSlotArgs>' is not assignable to the same property in base type 'object & Record<never, any> & Vue'.
  Type 'ScopedSlots<ScopedSlotArgs>' is not assignable to type '{ [key: string]: ScopedSlot | undefined; }'.
    Index signatures are incompatible.
      Type '(props: any) => string | VNodeChildrenArrayContents' is not assignable to type 'ScopedSlot'.
        Type 'string | VNodeChildrenArrayContents' is not assignable to type 'ScopedSlotChildren'.
          Type 'VNodeChildrenArrayContents' is not assignable to type 'ScopedSlotChildren'.
            Type 'VNodeChildrenArrayContents' is not assignable to type 'ScopedSlotArrayContents'.
              Types of property 'pop' are incompatible.
                Type '() => string | boolean | VNode | VNodeChildrenArrayContents | [ScopedSlot] | null | undefined' is not assignable to type '() => ScopedSlotChildren'.
                  Type 'string | boolean | VNode | VNodeChildrenArrayContents | [ScopedSlot] | null | undefined' is not assignable to type 'ScopedSlotChildren'.
                    Type 'null' is not assignable to type 'ScopedSlotChildren'.
    11 | export declare class Component<Props, EventsWithOn = {}, ScopedSlotArgs = {}> extends Vue {
    12 |     _tsxattrs: TsxComponentAttrs<Props, EventsWithOn, ScopedSlotArgs>;
  > 13 |     $scopedSlots: ScopedSlots<ScopedSlotArgs>;
       |     ^
    14 | }
    15 | /**
    16 |  * Create component from component options (Compatible with Vue.extend)
Version: typescript 3.2.2

it also throws the same error with typescript 3.1.6

I recently tried to upgrade my project deps, upgrading vue to "2.5.21".

@RnbWd
Copy link
Author

RnbWd commented Dec 17, 2018

I think its related to this commit vuejs/vue@448ba65 in vue

@wonderful-panda
Copy link
Owner

Probably v2.2.2 fix the problem. try it.

@RnbWd
Copy link
Author

RnbWd commented Dec 18, 2018

it works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants