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

Cannot read property 'unsubscribe' of undefined #2549

Closed
sunger opened this issue Oct 21, 2020 · 2 comments
Closed

Cannot read property 'unsubscribe' of undefined #2549

sunger opened this issue Oct 21, 2020 · 2 comments
Labels

Comments

@sunger
Copy link

sunger commented Oct 21, 2020

use nz-upload component
in
ng-zorro-antd 9.3.0
ngx-formly 5.10.4

with "upload.type.ts" template:

<nz-upload
nzAction="https://www.mocky.io/v2/5cc8019d300000980a055e76"
[nzHeaders]="{ authorization: 'authorization-text' }"
>
<button nz-button><i nz-icon nzType="upload"></i>Click to Upload</button>
</nz-upload>

get error:

core.js:6241 ERROR TypeError: Cannot read property 'unsubscribe' of undefined
at NzUploadComponent.ngOnDestroy (ng-zorro-antd-upload.js:1968)
at executeOnDestroys (core.js:14418)
at cleanUpView (core.js:14317)
at destroyViewTree (core.js:14081)
at destroyLView (core.js:14268)
at RootViewRef.destroy (core.js:15133)
at ComponentRef$1.destroy (core.js:34204)
at FormlyConfig.resolveFieldTypeRef (ngx-formly-core.js:561)
at CoreExtension.getFieldComponentInstance (ngx-formly-core.js:3395)
at CoreExtension.prePopulate (ngx-formly-core.js:3218)

source code of NzUploadComponent.ngOnDestroy:

ngOnDestroy(): void {
this.i18n$.unsubscribe();
}

@sunger sunger added the bug label Oct 21, 2020
@aitboudad
Copy link
Member

That's an ng-zorro-antd issue which should be fixed by NG-ZORRO/ng-zorro-antd#5971

Thanks!

@aitboudad
Copy link
Member

try now with ng-zorro-antd v10.1.0

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

No branches or pull requests

2 participants