Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Angular 16 SSR Injected CSS broken because of media=print  #3128

@albanx

Description

@albanx

🐞 Bug report

What modules are related to this issue?

  • builders
  • common
  • express-engine

Is this a regression?

Yes, the previous version in which this bug was not present was: 15.x

Description

Just updated my angular web app from 15 to 16.0.
After running the server side rendering I noticed that the CSS was broken.
After some extensive debugging found out that the injected stylesheets are being created with the wrong media type on the SSR only.

image

🔬 Minimal Reproduction

  1. Create an angular app
  2. Add SSR
  3. run build SSR
  4. run SSR with node
  5. open in the browser your local server
    Live example here https://test1.homezone.al/properties/sale

The issue is clearly related to the change in this line: https://github.com/angular/universal/blob/main/modules/common/engine/src/engine.ts#L105

🔥 Exception or Error

CSS media print instead of ALL

🌍 Your Environment


Angular CLI: 16.0.1
Node: 18.15.0
Package Manager: npm 9.5.0
OS: win32 x64

Angular: 16.0.1
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, material, platform-browser, platform-browser-dynamic
... platform-server, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1600.1
@angular-devkit/build-angular   16.0.1
@angular-devkit/core            16.0.1
@angular-devkit/schematics      16.0.1
@nguniversal/builders           16.0.1
@nguniversal/express-engine     16.0.1
@schematics/angular             16.0.1
rxjs                            7.8.1
typescript                      5.0.4

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions