question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug(SSR): Angular Universal Broken after 10.0.0-next.2

See original GitHub issue

Reproduction

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:closed
  • Created 3 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
naveedahmed1commented, Jun 2, 2020

I can confirm that the issue has been fixed in 10.0.0-rc.0

1reaction
naveedahmed1commented, May 29, 2020

Thanks @devversion for sharing these details, we are using ngx-build-plus in our Angular app, for server we are using @angular-devkit/build-angular:server but 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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Page crash after converting to Angular Universal (SSR)
node exited with 1 code. The error message is what throws me. It seems like I'm trying to call getBoundingClientRect function but I...
Read more >
Server-side rendering (SSR) with Angular Universal
This guide describes Angular Universal, a technology that renders Angular applications on the server. A normal Angular application executes in the browser, ...
Read more >
Server-side Rendering (SSR) - Angular Universal Example
Server-side Rendering (SSR) - Angular Universal Example. Bundles the Universal version of the app with the Ahead-of-Time (AoT) compiler, using Node Express ...
Read more >
@nguniversal/express-engine - npm
Express Engine for running Server Angular Apps. Latest version: 15.0.0, last published: a month ago. Start using @nguniversal/express-engine ...
Read more >
Angular Universal: real app problems - InDepth.Dev
The server sends this HTML as a response to the GET request. Angular application on the server is destroyed after rendering. SSR issues...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found