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

Message: 在 HMR 开发模式下,会导致 Attempt to use a destroyed 异常 #3845

Closed
cipchk opened this issue Jul 22, 2019 · 4 comments · Fixed by #3859
Closed

Message: 在 HMR 开发模式下,会导致 Attempt to use a destroyed 异常 #3845

cipchk opened this issue Jul 22, 2019 · 4 comments · Fixed by #3859

Comments

@cipchk
Copy link
Member

cipchk commented Jul 22, 2019

重现

https://stackblitz.com/edit/angular-uif43a?file=src%2Fapp%2Fapp.component.ts

步骤:

  • 打开 Stackblitz 后,在 template: '' 录入任意字符,触发一次 HMR 的加载
  • 点击按钮抛出 Attempt to use a destroyed

虽然在生产环境下无影响,但对于 HMR 开发环境下,会非常麻烦,特别是在需要触发 Message 时该错误会导致后续的动作无法继续,非要刷新 Command + R 后才会生效。

Version:

  • ng-zorro-antd latest
@zorro-bot
Copy link

zorro-bot bot commented Jul 22, 2019

Translation of this issue:

Message: In the HMR development mode, it will cause Attempt to use a destroyed exception.

Reproduce

https://stackblitz.com/edit/angular-uif43a?file=src%2Fapp%2Fapp.component.ts

step:

  • After opening Stackblitz, enter any character in template: '' to trigger an HMR load.
  • Click the button to throw Attempt to use a destroyed

Although it has no effect in the production environment, it is very troublesome for the HMR development environment. Especially when the message needs to be triggered, the error will cause the subsequent actions to not continue. It will take effect after the Command + R is refreshed.

@wzhudev
Copy link
Member

wzhudev commented Jul 24, 2019

🤔

debugging...


💡

Because of this line.

When the application hot reloads, containerMap still holds the reference to the old container component. But I am not sure removing this would break anything. Trying...

@wzhudev
Copy link
Member

wzhudev commented Jul 24, 2019

@cipchk I cannot reproduce the problem in a local project. Any idea?

@cipchk
Copy link
Member Author

cipchk commented Jul 24, 2019

@wendzhue A minimal reproduction link: https://github.com/cipchk/zorro-issues-3845

Setps:

  1. running npm run hmr
  2. can be click button
  3. modified app.component.html
  4. can't be click button

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.

2 participants