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

bug(cdk/platform.): scrolling.ts SSR build Element is not defined #22259

Closed
dodongphure opened this issue Mar 17, 2021 · 1 comment · Fixed by #22260
Closed

bug(cdk/platform.): scrolling.ts SSR build Element is not defined #22259

dodongphure opened this issue Mar 17, 2021 · 1 comment · Fixed by #22260
Assignees
Labels
area: cdk/platform P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@dodongphure
Copy link

Hello, I had an issue for SSR building with cdk/platform at this line https://github.com/angular/components/blob/master/src/cdk/platform/features/scrolling.ts#L49:
const scrollToFunction: Function|undefined = Element.prototype.scrollTo;
-> ReferenceError: Element is not defined

Environment

"@angular/animations": "^11.2.5",
"@angular/cdk": "^11.2.4",
"@angular/common": "^11.2.5",
"@angular/compiler": "^11.2.5",
"@angular/core": "^11.2.5",
"@angular-devkit/architect": "^0.1101.4",
"@angular-devkit/build-angular": "^0.1101.4",
"@angular/cli": "^11.1.4",
"@angular/compiler-cli": "~11.2.5",
"@angular/language-service": "^11.2.5",

@dodongphure dodongphure added the needs triage This issue needs to be triaged by the team label Mar 17, 2021
@crisbeto crisbeto self-assigned this Mar 17, 2021
@crisbeto crisbeto added area: cdk/platform has pr P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent and removed needs triage This issue needs to be triaged by the team labels Mar 17, 2021
crisbeto added a commit to crisbeto/material2 that referenced this issue Mar 17, 2021
…nt is stubbed out

Fixes an error that can be thrown by the `supportsScrollBehavior` helper if the
global `document` variable is stubbed out.

Fixes angular#22259.
andrewseguin pushed a commit that referenced this issue Mar 19, 2021
…nt is stubbed out (#22260)

Fixes an error that can be thrown by the `supportsScrollBehavior` helper if the
global `document` variable is stubbed out.

Fixes #22259.
andrewseguin pushed a commit that referenced this issue Mar 19, 2021
…nt is stubbed out (#22260)

Fixes an error that can be thrown by the `supportsScrollBehavior` helper if the
global `document` variable is stubbed out.

Fixes #22259.

(cherry picked from commit 50b3207)
@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 Apr 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: cdk/platform P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
2 participants