Skip to content

fix(overlay): use HTMLDocument instead of Document #10813

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

Closed
wants to merge 1 commit into from

Conversation

patrickmichalina
Copy link

In latest RC, constructing with the Document token creates a fatal error:

[1] ReferenceError: Document is not defined
[1]     at Overlay.ctorParameters (/Users/patrick/Code/fusing-angular/node_modules/@angular/src/cdk/overlay/overlay.ts:54:1)
[1]     at ReflectionCapabilities._ownParameters (/execroot/angular/bazel-out/darwin-fastbuild/bin/packages/core/npm_package.esm5/packages/core/src/reflection/reflection_capabilities.js:82:76)
[1]     at ReflectionCapabilities.parameters (/execroot/angular/bazel-out/darwin-fastbuild/bin/packages/core/npm_package.esm5/packages/core/src/reflection/reflection_capabilities.js:109:31)
[1]     at JitReflector.parameters (/execroot/angular/bazel-out/darwin-fastbuild/bin/packages/platform-browser-dynamic/npm_package.esm5/packages/platform-browser-dynamic/src/compiler_reflector.js:30:44)
[1]     at CompileMetadataResolver._getDependenciesMetadata (/execroot/angular/bazel-out/darwin-fastbuild/bin/packages/compiler/npm_package.esm5/packages/compiler/src/metadata_resolver.js:770:54)
[1]     at CompileMetadataResolver._getTypeMetadata (/execroot/angular/bazel-out/darwin-fastbuild/bin/packages/compiler/npm_package.esm5/packages/compiler/src/metadata_resolver.js:720:26)
[1]     at CompileMetadataResolver._getInjectableTypeMetadata (/execroot/angular/bazel-out/darwin-fastbuild/bin/packages/compiler/npm_package.esm5/packages/compiler/src/metadata_resolver.js:942:21)
[1]     at CompileMetadataResolver.getProviderMetadata (/execroot/angular/bazel-out/darwin-fastbuild/bin/packages/compiler/npm_package.esm5/packages/compiler/src/metadata_resolver.js:951:22)
[1]     at /execroot/angular/bazel-out/darwin-fastbuild/bin/packages/compiler/npm_package.esm5/packages/compiler/src/metadata_resolver.js:889:49
[1]     at Array.forEach (<anonymous>)
[1]     at CompileMetadataResolver._getProvidersMetadata (/execroot/angular/bazel-out/darwin-fastbuild/bin/packages/compiler/npm_package.esm5/packages/compiler/src/metadata_resolver.js:849:19)
[1]     at CompileMetadataResolver.getNgModuleMetadata (/execroot/angular/bazel-out/darwin-fastbuild/bin/packages/compiler/npm_package.esm5/packages/compiler/src/metadata_resolver.js:568:67)
[1]     at CompileMetadataResolver.getNgModuleSummary (/execroot/angular/bazel-out/darwin-fastbuild/bin/packages/compiler/npm_package.esm5/packages/compiler/src/metadata_resolver.js:398:35)
[1]     at /execroot/angular/bazel-out/darwin-fastbuild/bin/packages/compiler/npm_package.esm5/packages/compiler/src/metadata_resolver.js:485:55
[1]     at Array.forEach (<anonymous>)
[1]     at CompileMetadataResolver.getNgModuleMetadata (/execroot/angular/bazel-out/darwin-fastbuild/bin/packages/compiler/npm_package.esm5/packages/compiler/src/metadata_resolver.js:463:49)

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Apr 12, 2018
@crisbeto
Copy link
Member

@patrickmichalina under what version of Angular did you get that error? We used to get that one which is why we were casting the document to any, but it shouldn't be an issue in 6.0.0 anymore.

@patrickmichalina
Copy link
Author

The latest of all angular and material throws this error. I’ve been casting to HTMLDocument in all my Universal apps and it works beautifully.

@jelbourn
Copy link
Member

jelbourn commented Apr 12, 2018

@crisbeto I'm not sure we should have done #10775. AFAIK, nothing in Angular changed that would have "solved" this issue, largely because it comes from TypeScript. TypeScript will always retain types for methods with a decorator (constructor in most of these cases). In the code paths we use in our testing, it's probably that we end up with down-leveled decorators that eliminate this problem, but people with other setups could still run into it.

@jelbourn
Copy link
Member

Closing this since we reverted #10775

@jelbourn jelbourn closed this Apr 12, 2018
@patrickmichalina
Copy link
Author

Thanks!

@patrickmichalina patrickmichalina deleted the patch-1 branch April 15, 2018 03:36
@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
cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants