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

FocusTrap: 'Node is not defined' in server side rendering #8981

Closed
leo6104 opened this issue Dec 14, 2017 · 1 comment · Fixed by #9001
Closed

FocusTrap: 'Node is not defined' in server side rendering #8981

leo6104 opened this issue Dec 14, 2017 · 1 comment · Fixed by #9001
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 14, 2017

Bug, feature request, or proposal:

Bug

What is the expected behavior?

the error not occur.

What is the current behavior?

0|mapia-mo |     ERROR ReferenceError: Node is not defined
0|mapia-mo |     at FocusTrap._getFirstTabbableElement (/var/app/current/server.js:28081:75)
0|mapia-mo |     at FocusTrap._getRegionBoundary (/var/app/current/server.js:27994:55)
0|mapia-mo |     at FocusTrap.focusFirstTabbableElement (/var/app/current/server.js:28038:55)
0|mapia-mo |     at FocusTrap.focusInitialElement (/var/app/current/server.js:28023:21)
0|mapia-mo |     at SafeSubscriber._next (/var/app/current/server.js:27917:71)
0|mapia-mo |     at SafeSubscriber.__tryOrUnsub (/var/app/current/server.js:27392:16)
0|mapia-mo |     at SafeSubscriber.next (/var/app/current/server.js:27339:22)
0|mapia-mo |     at Subscriber._next (/var/app/current/server.js:27279:26)
0|mapia-mo |     at Subscriber.next (/var/app/current/server.js:27243:18)
0|mapia-mo |     at TakeSubscriber._next (/var/app/current/server.js:41499:30)
0|mapia-mo |     at TakeSubscriber.Subscriber.next (/var/app/current/server.js:27243:18)
0|mapia-mo |     at SafeSubscriber.schedulerFn [as _next] (/var/app/current/server.js:4610:52)
0|mapia-mo |     at SafeSubscriber.__tryOrUnsub (/var/app/current/server.js:27392:16)
0|mapia-mo |     at SafeSubscriber.next (/var/app/current/server.js:27339:22)
0|mapia-mo |     at Subscriber._next (/var/app/current/server.js:27279:26)
0|mapia-mo |     at Subscriber.next (/var/app/current/server.js:27243:18)
0|mapia-mo |     at EventEmitter.Subject.next (/var/app/current/server.js:24318:25)
0|mapia-mo |     at EventEmitter.emit (/var/app/current/server.js:4590:46)
0|mapia-mo |     at /var/app/current/server.js:4995:79
0|mapia-mo |     at ZoneDelegate.invoke (/var/app/current/server.js:154462:26)
0|mapia-mo |     at Zone.run (/var/app/current/server.js:154212:43)
0|mapia-mo |     at NgZone.runOutsideAngular (/var/app/current/server.js:4972:69)
0|mapia-mo |     at checkStable (/var/app/current/server.js:4995:26)
0|mapia-mo |     at Object.onHasTask (/var/app/current/server.js:5037:21)
0|mapia-mo |     at ZoneDelegate.hasTask (/var/app/current/server.js:154515:37)
0|mapia-mo |     at ZoneDelegate._updateTaskCount (/var/app/current/server.js:154535:22)
0|mapia-mo |     at Zone._updateTaskCount (/var/app/current/server.js:154359:34)
0|mapia-mo |     at Zone.runTask (/var/app/current/server.js:154279:30)
0|mapia-mo |     at ZoneTask.invokeTask (/var/app/current/server.js:154569:34)
0|mapia-mo |     at ZoneTask.invoke (/var/app/current/server.js:154558:48)
0|mapia-mo |     at data.args.(anonymous function) (/var/app/current/server.js:155251:25)
0|mapia-mo |     at _combinedTickCallback (internal/process/next_tick.js:138:11)
0|mapia-mo |     at process._tickDomainCallback (internal/process/next_tick.js:218:9)

What are the steps to reproduce?

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

in ssr, sidenav open and focustrap trigger.

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

angular 5.1.1
material2 5.0.1

Is there anything else we should know?

https://github.com/angular/material2/blob/623be22e58d0074a109ac03bdf00afa7c60291ac/src/cdk/a11y/focus-trap.ts#L226
https://github.com/angular/material2/blob/623be22e58d0074a109ac03bdf00afa7c60291ac/src/cdk/a11y/focus-trap.ts#L248
this line might be cause

@leo6104 leo6104 changed the title Focus Trap: 'Node is not defined' in server side rendering FocusTrap: 'Node is not defined' in server side rendering Dec 14, 2017
@crisbeto crisbeto self-assigned this Dec 14, 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 14, 2017
crisbeto added a commit to crisbeto/material2 that referenced this issue Dec 14, 2017
Fixes a server-side rendering error due to the `Node` class not being being available in Universal.

Fixes angular#8981.
jelbourn pushed a commit that referenced this issue Jan 4, 2018
Fixes a server-side rendering error due to the `Node` class not being being available in Universal.

Fixes #8981.
jelbourn pushed a commit to jelbourn/components that referenced this issue Jan 8, 2018
Fixes a server-side rendering error due to the `Node` class not being being available in Universal.

Fixes angular#8981.
jelbourn pushed a commit to jelbourn/components that referenced this issue Jan 9, 2018
Fixes a server-side rendering error due to the `Node` class not being being available in Universal.

Fixes angular#8981.
jelbourn pushed a commit that referenced this issue Jan 9, 2018
Fixes a server-side rendering error due to the `Node` class not being being available in Universal.

Fixes #8981.
tinayuangao pushed a commit that referenced this issue Jan 10, 2018
Fixes a server-side rendering error due to the `Node` class not being being available in Universal.

Fixes #8981.
@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 8, 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