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

nz-modal Cannot read property 'nativeNode' of null #5328

Closed
wangxg6 opened this issue May 22, 2020 · 6 comments
Closed

nz-modal Cannot read property 'nativeNode' of null #5328

wangxg6 opened this issue May 22, 2020 · 6 comments
Assignees

Comments

@wangxg6
Copy link

wangxg6 commented May 22, 2020

Steps to reproduce

"dependencies": {
        "@angular/animations": "^9.1.9",
        "@angular/cdk": "^9.2.4",
        "@angular/common": "^9.1.9",
        "@angular/compiler": "^9.1.9",
        "@angular/core": "^9.1.9",
        "@angular/elements": "^9.1.9",
        "@angular/forms": "^9.1.9",
        "@angular/localize": "^9.1.9",
        "@angular/platform-browser": "^9.1.9",
        "@angular/platform-browser-dynamic": "^9.1.9",
        "@angular/router": "^9.1.9",
        "@webcomponents/custom-elements": "^1.4.1",
        "aes-js": "^3.1.2",
        "angular-highcharts": "^9.0.11",
        "angulartics2": "^9.0.1",
        "core-js": "^3.6.5",
        "crypto-js": "^4.0.0",
        "hammerjs": "^2.0.8",
        "highcharts": "^8.1.0",
        "immer": "^6.0.5",
        "jquery": "^3.2.1",
        "lodash": "^4.17.15",
        "lodash-es": "^4.17.10",
        "lru_map": "^0.3.3",
        "measure-font": "^1.0.0",
        "moment": "^2.24.0",
        "net": "^1.0.2",
        "ng-zorro-antd": "^9.1.2",
        "raven-js": "^3.27.2",
        "rxjs": "^6.5.3",
        "toastr": "^2.1.4",
        "tslib": "^1.10.0",
        "zone.js": "~0.10.2"
    },

打开弹框,关闭弹框后控制台报错,升级了多个项目,就一个项目有这个问题,稳定复现,任何一个弹框都会有这样的问题

What is expected?

弹框关闭

What is actually happening?

弹框关闭,报错
TypeError: Cannot read property 'nativeNode' of null
at removeDebugNodeFromIndex (core.js:30099)
at DebugRenderer2.push../node_modules/@angular/core/fesm5/core.js.DebugRenderer2.destroyNode (core.js:32384)
at destroyViewNodes (core.js:31600)
at destroyView (core.js:31588)
at callViewAction (core.js:31706)
at execEmbeddedViewsAction (core.js:31649)
at destroyView (core.js:31578)
at callWithDebugContext (core.js:32324)
at Object.debugDestroyView [as destroyView] (core.js:32026)
at ViewContainerRef_.push../node_modules/@angular/core/fesm5/core.js.ViewContainerRef_.clear (core.js:22245)
at NgIf.push../node_modules/@angular/common/fesm5/common.js.NgIf._updateView (common.js:3522)
at NgIf.set [as ngIf] (common.js:3478)
at updateProp (core.js:22883)
at checkAndUpdateDirectiveInline (core.js:22638)
at checkAndUpdateNodeInline (core.js:31501)
at checkAndUpdateNode (core.js:31463)
at debugCheckAndUpdateNode (core.js:32100)
at debugCheckDirectivesFn (core.js:32060)

Environment Info
ng-zorro-antd 9.1.2
Browser chrome 81.0.4044.138

build 和功能都不受影响,只是控制台报错

@wangxg6
Copy link
Author

wangxg6 commented May 22, 2020

<nz-modal
    *ngIf="showModal"
    [nzVisible]="true"
    (nzOnCancel)="showModal = false"
>
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
</nz-modal>

@wangxg6
Copy link
Author

wangxg6 commented May 22, 2020

image

@mdragoss
Copy link

mdragoss commented May 23, 2020

This problem is not related to nz-modal , maybe your register twice nzModalModule

@wangxg6
Copy link
Author

wangxg6 commented May 25, 2020

This problem is not related to nz-modal , maybe your register twice nzModalModule

but when i use ng-zorro-antd 8.x it has not this error

@wangxg6
Copy link
Author

wangxg6 commented May 25, 2020

This problem is not related to nz-modal , maybe your register twice nzModalModule

i import NgZorroAntdModule twice in different module,thx

@wangxg6 wangxg6 closed this as completed May 25, 2020
@hsuanxyz
Copy link
Member

I will reopen so that others with the same problem can find it until it fixed.

@hsuanxyz hsuanxyz reopened this May 25, 2020
@hsuanxyz hsuanxyz changed the title nz-modal destroyed twice. nz-modal Cannot read property 'nativeNode' of null May 25, 2020
hsuanxyz added a commit to hsuanxyz/ng-zorro-antd that referenced this issue May 26, 2020
hsuanxyz added a commit to hsuanxyz/ng-zorro-antd that referenced this issue May 26, 2020
hsuanxyz added a commit to hsuanxyz/ng-zorro-antd that referenced this issue Jun 16, 2020
hsuanxyz added a commit to hsuanxyz/ng-zorro-antd that referenced this issue Aug 5, 2020
…5332)

* fix(module:modal): some cases there is no changes detected

close NG-ZORRO#5328, close NG-ZORRO#5287, close NG-ZORRO#5259

* docs(module:modal): update the API docs

close NG-ZORRO#3743
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants