You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't think so, as the CSP feature was added in 16
Description
We started using the "ngCspNonce" attribute when we upgraded to Angular 16. The application builds and starts, but upon sending a request to a SSR page we get an "Internal server error" in the browser. The console also displays an error message:
TypeError: link.prev?.setAttribute is not a function
The same bug was reported in @angular-devkit/build-angular here:
…rnal stylesheets
The problem with the previous approach is that it assumes that a `link` tag processed by Critters will be preceded by a `style` tag that was inserted by Critters. This assumption might not necessarily be true if Critters is unable to resolve the content of the linked styles.
Closes: angular#3241
…rnal stylesheets
The problem with the previous approach is that it assumes that a `link` tag processed by Critters will be preceded by a `style` tag that was inserted by Critters. This assumption might not necessarily be true if Critters is unable to resolve the content of the linked styles.
Closes: #3241
…rnal stylesheets
The problem with the previous approach is that it assumes that a `link` tag processed by Critters will be preceded by a `style` tag that was inserted by Critters. This assumption might not necessarily be true if Critters is unable to resolve the content of the linked styles.
Closes: #3241
(cherry picked from commit 1aed4b8)
🐞 Bug report
What modules are related to this issue?
Is this a regression?
I don't think so, as the CSP feature was added in 16
Description
We started using the "ngCspNonce" attribute when we upgraded to Angular 16. The application builds and starts, but upon sending a request to a SSR page we get an "Internal server error" in the browser. The console also displays an error message:
The same bug was reported in @angular-devkit/build-angular here:
This is the PR where they fixed it: angular/angular-cli#25584
After this fix was released I expected our app to work, but I found angular universal has its own version of "inline-css-processor.ts" here:
https://github.com/angular/universal/blob/5974f8e769e75023cacbf0cc52f7c1a6ae534f45/modules/common/tools/src/inline-css-processor.ts#L157C21-L157C21
I believe the fix should be applied to Angular Universal as well.
🔬 Minimal Reproduction
inlineCritical": true
in angular.jsonHere is the repo i made for the issue I reported in angular-cli. The same setup should yield the same problem in angular universal: https://github.com/majoer/angular-csp-link-bug
🔥 Exception or Error
🌍 Your Environment
The text was updated successfully, but these errors were encountered: