-
Notifications
You must be signed in to change notification settings - Fork 6.8k
bug(SSR): Angular Universal Broken after 10.0.0-next.2 #19483
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
Comments
Hello @naveedahmed1. Thanks for the issue! This was an intentional change we landed as part of angular/angular#37221 (comment). You can find more details there and in angular/angular#30586. We will revert the decorator change though as part of another issue that came up with #19454. That should fix these SSR failures. Though ideally, you wouldn't have been affected at all by these decorators as the CLI should have optimizations for this. Would you still be able to help providing context on this? i.e. do you use the default server builder for doing SSR? Usually the default CLI server builder should remove these decorators and the error should not surface at all. That was part of the reason why we said that this change is okay to land (as CLI consumers should not be affected). Here is the code that removes the decorators. |
Thanks @devversion for sharing these details, we are using I have added you to a private repo, if you could please take a look and suggest if I'm missing something? |
I believe this should be fixed by the 10.0.0-rc.0 release we published today. Let us know if that's not the case |
Yeah, this is fixed quite sure, but I wanted to figure out why it failed in the first place as CLI projects should have never been affected by this change, unless build optimizer is disabled. |
I can confirm that the issue has been fixed in 10.0.0-rc.0 |
@devversion this was the decorator down-leveling issue, no? |
@jelbourn Yeah. CLI projects should have not been affected at all in I'm going to check that for the sake of completeness if anything is special in the CLI project, but there is no real action on the Angular components team side. |
@naveedahmed1 Thanks for sharing your app. Looks like nothing special in your app. My impression was that CLI would not care about decorators being downleveled or not, but it looks like for the server target, build optimizer is disabled, so it makes sense that this error surfaced. Thanks! |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Reproduction
After upgrading my app from
10.0.0-next.1
to10.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
The text was updated successfully, but these errors were encountered: