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

NzDrawerComponent Type Definition error #7620

Closed
merih-sakarya opened this issue Aug 31, 2022 · 6 comments · Fixed by #7668
Closed

NzDrawerComponent Type Definition error #7620

merih-sakarya opened this issue Aug 31, 2022 · 6 comments · Fixed by #7668
Assignees

Comments

@merih-sakarya
Copy link

Reproduction link

https://stackblitz.com/edit/ng-zorro-antd-ivy-kotjtq

Steps to reproduce

I am upgrading to version 14. However, the Drawer Component gives an error during the build.

What is expected?

Property 'nzContentParams' in type 'NzDrawerComponent<T, R, D>' is not assignable to the same property in base type 'NzDrawerOptionsOfComponent<any, any>'.

What is actually happening?

Error: node_modules/ng-zorro-antd/drawer/drawer.component.d.ts:73:5 - error TS2416: Property 'nzContentParams' in type 'NzDrawerComponent<T, R, D>' is not assignable to the same property in base type 'NzDrawerOptionsOfComponent<any, any>'.
  Type 'D | undefined' is not assignable to type 'Partial<any> | undefined'.
    Type 'D' is not assignable to type 'Partial<any> | undefined'.
      Type 'D' is not assignable to type 'Partial<any>'.

73     nzContentParams?: D;
       ~~~~~~~~~~~~~~~

  node_modules/ng-zorro-antd/drawer/drawer.component.d.ts:17:70
    17 export declare class NzDrawerComponent<T = NzSafeAny, R = NzSafeAny, D = NzSafeAny> extends NzDrawerRef<T, R> implements OnInit, OnDestroy, AfterViewInit, OnChanges, NzDrawerOptionsOfComponent {
                                                                            ~~~~~~~~~~~~~
    This type parameter might need an `extends Partial<any>` constraint.
  node_modules/ng-zorro-antd/drawer/drawer.component.d.ts:17:70
    17 export declare class NzDrawerComponent<T = NzSafeAny, R = NzSafeAny, D = NzSafeAny> extends NzDrawerRef<T, R> implements OnInit, OnDestroy, AfterViewInit, OnChanges, NzDrawerOptionsOfComponent {
                                                                            ~~~~~~~~~~~~~
    This type parameter might need an `extends Partial<any> | undefined` constraint.
Environment Info
ng-zorro-antd 14.0.0
Browser Chrome
@merih-sakarya
Copy link
Author

Downgrading TypeScript version from 4.8.2 to 4.7.2 fixed the issue

@seytzhan
Copy link

seytzhan commented Sep 8, 2022

Yes. I confirm that NzDrawerComponent has this error with TypeScript version 4.8.2.

@pburgmer
Copy link
Contributor

I also run into this problem.

@Stychlok
Copy link

We do also have this problem with typescript 4.8.2

@micobarac
Copy link

Same problem here with Typescript 4.8.4

@Nicoss54
Copy link
Collaborator

Nicoss54 commented Dec 1, 2022

Hey :) this pull request here will fix this problem :)

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

Successfully merging a pull request may close this issue.

7 participants