bug(SSR): Angular Universal Broken after 10.0.0-next.2
See original GitHub issueReproduction
After upgrading my app from 10.0.0-next.1 to 10.0.0-next.2, the SSR is broken.
I am not sure which of the component is actually causing this issue.
Here’s the error message which I see in log:
NodeInvocationException: Prerendering failed because of error: ReferenceError: HTMLElement is not defined at D:\MyProject\dist-server\main.js:1:1552649 at Module.FKr1 (D:\MyProject\dist-server\main.js:1:1553177) at __webpack_require__ (D:\MyProject\dist-server\main.js:1:295) at Module.dNgK (D:\MyProject\dist-server\main.js:1:2631057) at __webpack_require__ (D:\MyProject\dist-server\main.js:1:295) at Object.6GTT (D:\MyProject\dist-server\main.js:1:591420) at __webpack_require__ (D:\MyProject\dist-server\main.js:1:295) at Object.zkdS (D:\MyProject\dist-server\main.js:1:4807955) at __webpack_require__ (D:\MyProject\dist-server\main.js:1:295) at Object.8b2W (D:\MyProject\dist-server\main.js:1:665835)
Expected Behavior
What behavior were you expecting to see? It should work without throwing any error.
Actual Behavior
Throws below error:
NodeInvocationException: Prerendering failed because of error: ReferenceError: HTMLElement is not defined at D:\MyProject\dist-server\main.js:1:1552649 at Module.FKr1 (D:\MyProject\dist-server\main.js:1:1553177) at __webpack_require__ (D:\MyProject\dist-server\main.js:1:295) at Module.dNgK (D:\MyProject\dist-server\main.js:1:2631057) at __webpack_require__ (D:\MyProject\dist-server\main.js:1:295) at Object.6GTT (D:\MyProject\dist-server\main.js:1:591420) at __webpack_require__ (D:\MyProject\dist-server\main.js:1:295) at Object.zkdS (D:\MyProject\dist-server\main.js:1:4807955) at __webpack_require__ (D:\MyProject\dist-server\main.js:1:295) at Object.8b2W (D:\MyProject\dist-server\main.js:1:665835)
Environment
Angular: 10.0.0-rc.0
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, service-worker
Ivy Workspace: <error>
Package Version
--------------------------------------------------------------------
@angular-devkit/architect 0.901.7
@angular-devkit/build-angular 0.1000.0-rc.0
@angular-devkit/build-optimizer 0.901.7
@angular-devkit/build-webpack 0.901.7
@angular-devkit/core 10.0.0-rc.0
@angular-devkit/schematics 10.0.0-rc.0
@angular/cdk 10.0.0-next.2
@angular/fire 6.0.0
@angular/google-maps 10.0.0-next.2
@angular/material 10.0.0-next.2
@angular/platform-server 10.0.0-next.6
@angular/pwa 0.1000.0-rc.0
@ngtools/webpack 9.1.7
@nguniversal/module-map-ngfactory-loader 9.0.0-next.9
@schematics/angular 10.0.0-rc.0
@schematics/update 0.1000.0-rc.0
rxjs 6.5.5
typescript 3.9.3
webpack 4.42.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (6 by maintainers)

Top Related StackOverflow Question
I can confirm that the issue has been fixed in 10.0.0-rc.0
Thanks @devversion for sharing these details, we are using
ngx-build-plusin our Angular app, for server we are using@angular-devkit/build-angular:serverbut as you mentioned and also mentioned in the comments default builders should handle this, that why are we still seeing this issue?I have added you to a private repo, if you could please take a look and suggest if I’m missing something?