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

AriaDescriber.ngOnDestory() make SSR 500 error. #8901

Closed
leo6104 opened this issue Dec 9, 2017 · 6 comments · Fixed by #8903
Closed

AriaDescriber.ngOnDestory() make SSR 500 error. #8901

leo6104 opened this issue Dec 9, 2017 · 6 comments · Fixed by #8903
Assignees
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@leo6104
Copy link

leo6104 commented Dec 9, 2017

Bug, feature request, or proposal:

Bug

What is the expected behavior?

AriaDescriber should not throw error.

What is the current behavior?

In Universal http request, sometimes server.js throw Error like this.

{ NOT_FOUND_ERR: NOT_FOUND_ERR (8): the object can not be found here
0|pc |     at Object.exports.NotFoundError (/var/app/current/server.js:24856:44)
0|pc |     at HTMLBodyElement.removeChild (/var/app/current/server.js:25244:44)
0|pc |     at AriaDescriber._deleteMessagesContainer (/var/app/current/server.js:36328:29)
0|pc |     at AriaDescriber.ngOnDestroy (/var/app/current/server.js:36260:18)
0|pc |     at callNgModuleLifecycle (/var/app/current/server.js:11290:26)
0|pc |     at NgModuleRef_.destroy (/var/app/current/server.js:12468:9)
0|pc |     at /var/app/current/server.js:5961:73
0|pc |     at Array.forEach (<anonymous>)
0|pc |     at PlatformRef.destroy (/var/app/current/server.js:5961:31)
0|pc |     at /var/app/current/server.js:128246:22
0|pc |     at ZoneDelegate.invoke (/var/app/current/server.js:119147:26)
0|pc |     at Zone.run (/var/app/current/server.js:118897:43)
0|pc |     at /var/app/current/server.js:119628:57
0|pc |     at ZoneDelegate.invokeTask (/var/app/current/server.js:119180:31)
0|pc |     at Zone.runTask (/var/app/current/server.js:118947:47)
0|pc |     at drainMicroTaskQueue (/var/app/current/server.js:119357:35)
0|pc |     at ZoneTask.invokeTask (/var/app/current/server.js:119258:21)
0|pc |     at ZoneTask.invoke (/var/app/current/server.js:119243:48)
0|pc |     at data.args.(anonymous function) (/var/app/current/server.js:119936:25)
0|pc |     at _combinedTickCallback (internal/process/next_tick.js:138:11)
0|pc |     at process._tickDomainCallback (internal/process/next_tick.js:218:9)
0|pc |   code: 8,

What are the steps to reproduce?

Sorry for not providing reproduction. It occur not always. (intermittently occur)

What is the use-case or motivation for changing an existing behavior?

It is regression issue because this 500 error seen after angular material upgrade

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular 5.1.0
Material 5.0.0 latest

Is there anything else we should know?

I think f6cb2c6#diff-1f285a8492b86390f8e4fe94cf69d7e6R147
This refactor commit ( @crisbeto ) might be the root cause.

Please check for this.. @crisbeto I have to solve this problem for our company's production website.

@leo6104
Copy link
Author

leo6104 commented Dec 9, 2017

It is regression issue. after 5.0.0-rc.1 , this issue exists.

@crisbeto crisbeto self-assigned this Dec 9, 2017
@crisbeto crisbeto added has pr P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels Dec 9, 2017
crisbeto added a commit to crisbeto/material2 that referenced this issue Dec 9, 2017
Fixes a potential server-side rendering error when the `AriaDescriber` is being cleaned up.

Fixes angular#8901.
@crisbeto
Copy link
Member

crisbeto commented Dec 9, 2017

@leo6104 I wasn't able to reproduce it by injecting the describer, adding a message and then destroying it manually. Looking at your stack trace it seems as if the describer is being removed multiple times. I've submitted a PR with some extra checks around it.

@leo6104
Copy link
Author

leo6104 commented Dec 9, 2017

@crisbeto thank you for pull request!
Is there any rule (only import from root module?) for MatTooltipModule?
MatTooltipModule use AriaDescriber and my project imports MatTooltipModule multiple times in sub module and root module.

AppModule imports ProfileModule, PostModule, MatTooltipModule
ProfileModule import MatTooltipModule
PostModule import MatTooltipModule.

I think multiple times remove can be occur like this scenario
(PostModule destroy -> messagesContainer removed, AppModule destroy -> throw error because already removed)
(ProfileModule destroy -> messagesContainer removed, AppModule destroy -> throw error because already removed)

@leo6104
Copy link
Author

leo6104 commented Dec 9, 2017

Hmm... I remove MatTooltipModule in AppModule, only import in ProfileModule/PostModule but still throw error in angular/material 5.0.0 latest published version.

@leo6104
Copy link
Author

leo6104 commented Dec 11, 2017

Remove MatTooltipModule from PostModule is temporary solution for me. (import MatTooltipModule one time)
Multiple times import MatTooltipModule is the cause of this issue.

andrewseguin pushed a commit that referenced this issue Dec 13, 2017
Fixes a potential server-side rendering error when the `AriaDescriber` is being cleaned up.

Fixes #8901.
andrewseguin pushed a commit that referenced this issue Dec 19, 2017
Fixes a potential server-side rendering error when the `AriaDescriber` is being cleaned up.

Fixes #8901.
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants