Skip to content

Repository files navigation

Angular Universal CSP link bug reproduction.

How to reproduce

  1. Create a new angular project:
ng new
  1. Add nonce to app-root as explained here: https://angular.io/guide/security#content-security-policy
    We use a dummy value for nonce just for testing, for example:
<!-- src/index.html -->
<app-root ngCspNonce="123"></app-root>
  1. Add a stylesheet link to head, for example:
<!-- src/index.html -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" />
  1. Build and see error message
npm run build

# Index html generation failed.
# link.prev?.setAttribute is not a function

Releases

Packages

Contributors

Languages