Bug: "link.prev?.setAttribute is not a function" - CSP and <link rel="stylesheet"> #25575
Closed
1 task
Labels
area: @angular-devkit/build-angular
needs: investigation
Requires some digging to determine if action is needed
Command
build
Is this a regression?
The previous version in which this bug was not present was
No response
Description
ng build breaks when we combine ngCspNonce with a hard-coded style-sheet link in index.html.
We can replicate this in a new angular app. However, this problem first appeared for us in an Angular Universal app, with the following setup:
We believe this is where the bug occurs
https://github.com/angular/angular-cli/blob/main/packages/angular_devkit/build_angular/src/utils/index-file/inline-critical-css.ts#L149
Minimal Reproduction
How to reproduce:
<link rel="stylesheet" href="..." />
Repo with minimal reproduction: https://github.com/majoer/angular-csp-link-bug
Exception or Error
Your Environment
Anything else relevant?
No response
The text was updated successfully, but these errors were encountered: